Skip to content

Adjusting public methods arguments to support JSON-RPC #92

Open
@DerAndereAndi

Description

Right now the public methods arguments require an argument entity spineapi.EntityRemoteInterface to specify which entity of which remote device is meant. This can not be used / represented via JSON.

To make this work, the idea would be to use an SPINE model.EntityAddressType similar data type. The SPINE data definition is:

type EntityAddressType struct {
	Device *AddressDeviceType  `json:"device,omitempty"`
	Entity []AddressEntityType `json:"entity,omitempty"`
}

A compatible and easier to use data type would be:

type EntityAddressType struct {
	Device string
	Entity []uint
}

This can be easily represented in JSON and also used to get the corresponding entity spineapi.EntityRemoteInterface which is needed to invoke the functions. The data structure can also be easily created in the callback functions from an entity spineapi.EntityRemoteInterface data type using a generic helper method.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions