Documentation ¶
Index ¶
- func Decode(input, output interface{}, hooks ...mapstructure.DecodeHookFunc) error
- func StringInterfaceToJsonRawMessage(sourceType, targetType reflect.Type, sourceData interface{}) (interface{}, error)
- type Action
- type AnalogCommand
- type AnalogValueType
- type Command
- type CommandType
- type DigitalCommand
- type EnabledDays
- type SimpleCommand
- type Status
- type TimeIndication
- type VersionIndication
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
func Decode(input, output interface{}, hooks ...mapstructure.DecodeHookFunc) error
Types ¶
type AnalogCommand ¶ added in v1.5.0
type AnalogCommand struct { ApplianceID string `json:"applianceID"` Value float64 `json:"value,float"` ValueType AnalogValueType `json:"value_type,int,omitempty"` }
AnalogCommand is a command to set a value on an analog device. By default the ValueType is 0: Absolute.
type AnalogValueType ¶ added in v1.5.0
type AnalogValueType uint8
AnalogValueType is an enum to define how to handle an analog value
const ( Absolute AnalogValueType = iota Relative )
Available AnalogValueType
type Command ¶
type Command struct { Type CommandType `json:"type"` Data json.RawMessage `json:"data"` }
Command is the root object in every message
func NewCommand ¶
func NewCommand(t CommandType, data interface{}) *Command
NewCommand creates a command given a type and his content
type CommandType ¶
type CommandType uint8
CommandType represent the type of the current message
const ( HeartbeatType CommandType = iota DigitalCommandType AnalogCommandType StatusSubscriptionCommandType StatusNotificationCommandType VersionRequestCommandType VersionReplyCommandType // Actor commands: request and reply ActionRequestCommandType ActionReplyCommandType // private commands (sent on the loopback address) StatusUpdateCommandType IODeviceStatusChangedCommandType // Telegram notifications TelegramNotificationCommandType // special command types AnyIncomingCommandType AnyOutgoingCommandType )
Command types types used in various plugins
func (CommandType) String ¶
func (i CommandType) String() string
type DigitalCommand ¶
type DigitalCommand struct { Action Action `json:"action,int"` ApplianceID string `json:"applianceID"` }
DigitalCommand used to instruct the appliance to execute a Command on a gpio pin
type EnabledDays ¶
type EnabledDays uint16
EnabledDays days on which a TimedCommand is enabled used as binary flag
type SimpleCommand ¶
type SimpleCommand struct {
Action Action `json:"action,int"`
}
SimpleCommand is used to send a basic request regarding the whole system
type Status ¶
type Status map[string]interface{}
Status is the response to a status request Command the key is the handler name value can be anything
type TimeIndication ¶ added in v1.5.0
TimeIndication defines a basic struct for time with resolution of 1 min
type VersionIndication ¶
VersionIndication returns info about the current version and the optional update available