Documentation
¶
Index ¶
- Variables
- type Cluster
- type Command
- type CommandParameter
- type CommandParameterType
- type CommandType
- type Device
- type Group
- type MessageType
- type Router
- func (r *Router) Connect()
- func (r *Router) Disconnect()
- func (r *Router) ExecuteCommands()
- func (r *Router) GetClusters() ([]Cluster, error)
- func (r *Router) GetGroups() ([]Group, error)
- func (r *Router) GetRouters() ([]Router, error)
- func (r *Router) Id() int
- func (r *Router) Initialize()
- func (r *Router) Keepalive()
- func (r *Router) Listener()
- func (r *Router) Reconnect()
- func (r *Router) SendCommand(command Command) (string, error)
- type RouterConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var COMMAND_TYPES_DONT_LISTEN_FOR_RESPONSE = []CommandType{RECALL_SCENE, DIRECT_LEVEL_DEVICE, DIRECT_LEVEL_GROUP}
View Source
var CommandResponseTimeout = 60 * time.Second
View Source
var KeepAliveDuration = 120 * time.Second
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct { MessageType MessageType CommandType CommandType Params []CommandParameter Address string Result string IsPartial bool }
func NewCommand ¶
func NewCommand(messageType MessageType, commandType CommandType, params ...CommandParameter) Command
func ParseCommand ¶
func (*Command) ToIdentifier ¶
type CommandParameter ¶
type CommandParameter struct { Type CommandParameterType Value string }
func (*CommandParameter) ToString ¶
func (cp *CommandParameter) ToString() string
type CommandParameterType ¶
type CommandParameterType string
const ( VERSION CommandParameterType = "V" COMMAND CommandParameterType = "C" ADDRESS CommandParameterType = "@" GROUP CommandParameterType = "G" SCENE CommandParameterType = "S" BLOCK CommandParameterType = "B" FADE_TIME CommandParameterType = "F" LEVEL CommandParameterType = "L" PROPORTION CommandParameterType = "P" DISPLAY_SCREEN CommandParameterType = "D" SEQUENCE_NUMBER CommandParameterType = "Q" TIME CommandParameterType = "T" ACK CommandParameterType = "A" LATITUDE CommandParameterType = "L" LONGITUDE CommandParameterType = "E" TIME_ZONE_DIFFERENCE CommandParameterType = "Z" DAYLIGHT_SAVING_TIME CommandParameterType = "Y" CONSTANT_LIGHT_SCENE CommandParameterType = "K" FORCE_STORE_SCENE CommandParameterType = "O" )
type CommandType ¶
type CommandType string
const ( QUERY_CLUSTERS CommandType = "101" QUERY_ROUTERS CommandType = "102" QUERY_GROUP_DESCRIPTION CommandType = "105" QUERY_DEVICE_DESCRIPTION CommandType = "106" QUERY_DEVICE_TYPES_AND_ADDRESSES CommandType = "100" QUERY_DEVICE_STATE CommandType = "110" QUERY_WORKGROUP_NAME CommandType = "107" QUERY_DEVICE_LOAD_LEVEL CommandType = "152" QUERY_SCENE_INFO CommandType = "167" QUERY_ROUTER_TIME CommandType = "185" QUERY_LAST_SCENE_IN_GROUP CommandType = "109" QUERY_LAST_SCENE_IN_BLOCK CommandType = "103" QUERY_GROUP CommandType = "164" QUERY_GROUPS CommandType = "165" QUERY_SCENE_NAMES CommandType = "166" QUERY_ROUTER_VERSION CommandType = "190" QUERY_HELVARNET_VERSION CommandType = "191" //Commands DIRECT_LEVEL_DEVICE CommandType = "14" DIRECT_LEVEL_GROUP CommandType = "13" RECALL_SCENE CommandType = "11" )
type Device ¶
func (*Device) UpdateName ¶ added in v0.2.0
type Group ¶
func (*Group) UpdateName ¶
type MessageType ¶
type MessageType string
const ( MT_COMMAND MessageType = ">" MT_INTERNAL_COMMAND MessageType = "<" MT_REPLY MessageType = "?" MT_ERROR MessageType = "!" )
type Router ¶
type Router struct { RouterId int Config *RouterConfig Host string Port int // contains filtered or unexported fields }
func (*Router) Disconnect ¶
func (r *Router) Disconnect()
func (*Router) ExecuteCommands ¶
func (r *Router) ExecuteCommands()
func (*Router) GetClusters ¶ added in v0.2.0
func (*Router) GetRouters ¶ added in v0.2.0
func (*Router) Initialize ¶
func (r *Router) Initialize()
type RouterConfig ¶
type RouterConfig struct {
RouterId int
}
Click to show internal directories.
Click to hide internal directories.