Documentation ¶
Index ¶
- type Endpoint
- type HumidityEndpoint
- func (obj HumidityEndpoint) GetID() string
- func (obj HumidityEndpoint) GetOwnerID() string
- func (obj HumidityEndpoint) HandleMessage(cmd string, msg string)
- func (obj HumidityEndpoint) RegisterOnStateChangedCb(cb func(ep Endpoint, cmd string, state string, err error))
- func (obj HumidityEndpoint) RegisterSendMsgCb(cb func(topic string, msg string) error)
- func (obj HumidityEndpoint) SendConfig() error
- func (obj HumidityEndpoint) SendFeedbackMessage(cmd string, msg string) error
- func (obj *HumidityEndpoint) SendStatus() error
- func (obj HumidityEndpoint) SetOwnerID(id string)
- type IdentifyEndpoint
- func (obj IdentifyEndpoint) GetID() string
- func (obj IdentifyEndpoint) GetOwnerID() string
- func (obj IdentifyEndpoint) HandleMessage(cmd string, msg string)
- func (obj IdentifyEndpoint) RegisterOnStateChangedCb(cb func(ep Endpoint, cmd string, state string, err error))
- func (obj IdentifyEndpoint) RegisterSendMsgCb(cb func(topic string, msg string) error)
- func (obj IdentifyEndpoint) SendConfig() error
- func (obj IdentifyEndpoint) SendFeedbackMessage(cmd string, msg string) error
- func (obj *IdentifyEndpoint) SendStatus() error
- func (obj IdentifyEndpoint) SetOwnerID(id string)
- type LevelEndpoint
- func (obj LevelEndpoint) GetID() string
- func (obj LevelEndpoint) GetOwnerID() string
- func (obj LevelEndpoint) HandleMessage(cmd string, msg string)
- func (obj LevelEndpoint) RegisterOnStateChangedCb(cb func(ep Endpoint, cmd string, state string, err error))
- func (obj LevelEndpoint) RegisterSendMsgCb(cb func(topic string, msg string) error)
- func (obj LevelEndpoint) SendConfig() error
- func (obj LevelEndpoint) SendFeedbackMessage(cmd string, msg string) error
- func (obj *LevelEndpoint) SendStatus() error
- func (obj LevelEndpoint) SetOwnerID(id string)
- type MotionEndpoint
- func (obj MotionEndpoint) GetID() string
- func (obj MotionEndpoint) GetOwnerID() string
- func (obj MotionEndpoint) HandleMessage(cmd string, msg string)
- func (obj MotionEndpoint) RegisterOnStateChangedCb(cb func(ep Endpoint, cmd string, state string, err error))
- func (obj MotionEndpoint) RegisterSendMsgCb(cb func(topic string, msg string) error)
- func (obj MotionEndpoint) SendConfig() error
- func (obj MotionEndpoint) SendFeedbackMessage(cmd string, msg string) error
- func (obj *MotionEndpoint) SendStatus() error
- func (obj MotionEndpoint) SetOwnerID(id string)
- type OnOffEndpoint
- func (obj OnOffEndpoint) GetID() string
- func (obj OnOffEndpoint) GetOwnerID() string
- func (obj OnOffEndpoint) HandleMessage(cmd string, msg string)
- func (obj OnOffEndpoint) RegisterOnStateChangedCb(cb func(ep Endpoint, cmd string, state string, err error))
- func (obj OnOffEndpoint) RegisterSendMsgCb(cb func(topic string, msg string) error)
- func (obj OnOffEndpoint) SendConfig() error
- func (obj OnOffEndpoint) SendFeedbackMessage(cmd string, msg string) error
- func (obj *OnOffEndpoint) SendStatus() error
- func (obj OnOffEndpoint) SetOwnerID(id string)
- type TemperatureEndpoint
- func (obj TemperatureEndpoint) GetID() string
- func (obj TemperatureEndpoint) GetOwnerID() string
- func (obj TemperatureEndpoint) HandleMessage(cmd string, msg string)
- func (obj TemperatureEndpoint) RegisterOnStateChangedCb(cb func(ep Endpoint, cmd string, state string, err error))
- func (obj TemperatureEndpoint) RegisterSendMsgCb(cb func(topic string, msg string) error)
- func (obj TemperatureEndpoint) SendConfig() error
- func (obj TemperatureEndpoint) SendFeedbackMessage(cmd string, msg string) error
- func (obj *TemperatureEndpoint) SendStatus() error
- func (obj TemperatureEndpoint) SetOwnerID(id string)
- type ThermostatEndpoint
- func (obj ThermostatEndpoint) GetID() string
- func (obj ThermostatEndpoint) GetOwnerID() string
- func (obj ThermostatEndpoint) HandleMessage(cmd string, msg string)
- func (obj ThermostatEndpoint) RegisterOnStateChangedCb(cb func(ep Endpoint, cmd string, state string, err error))
- func (obj ThermostatEndpoint) RegisterSendMsgCb(cb func(topic string, msg string) error)
- func (obj ThermostatEndpoint) SendConfig() error
- func (obj ThermostatEndpoint) SendFeedbackMessage(cmd string, msg string) error
- func (obj *ThermostatEndpoint) SendStatus() error
- func (obj ThermostatEndpoint) SetOwnerID(id string)
- type ZeroEndpoint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Endpoint ¶
type Endpoint interface { // SetOwnerID sets endpoint's owner ID (device ID) SetOwnerID(id string) // GetOwnerID returns owner ID GetOwnerID() string // GetID returns endpoint ID GetID() string // HandleMessage handles incoming message HandleMessage(cmd string, msg string) // RegisterOnStateChangedCb registers callback funkcion that is called when endpoint state is changed RegisterOnStateChangedCb(cb func(ep Endpoint, cmd string, state string, err error)) // RegisterSendMsgCb registers callback function that is called when message from endpoint must be sent to HC GW RegisterSendMsgCb(cb func(topic string, msg string) error) // SendConfig sends endpoint config to HC GW SendConfig() error // SendFeedbackMessage sends feedback message to HC GW when some of the commands change state SendFeedbackMessage(cmd string, msg string) error // SendStatus sends current endpoint commands status SendStatus() error }
Endpoint interface collects all methods needed to handle device endpoint
type HumidityEndpoint ¶
type HumidityEndpoint struct {
// contains filtered or unexported fields
}
func NewHumidityEndpoint ¶
func (HumidityEndpoint) GetID ¶
func (obj HumidityEndpoint) GetID() string
GetID returns endpoint ID
func (HumidityEndpoint) GetOwnerID ¶
func (obj HumidityEndpoint) GetOwnerID() string
GetOwnerID returns owner ID
func (HumidityEndpoint) HandleMessage ¶
HandleMessage handles incoming message
func (HumidityEndpoint) RegisterOnStateChangedCb ¶
func (obj HumidityEndpoint) RegisterOnStateChangedCb(cb func(ep Endpoint, cmd string, state string, err error))
RegisterOnStateChangedCb registers callback funkcion that is called when endpoint state is changed
func (HumidityEndpoint) RegisterSendMsgCb ¶
RegisterSendMsgCb registers callback function that is called when message from endpoint must be sent to HC GW
func (HumidityEndpoint) SendConfig ¶
func (obj HumidityEndpoint) SendConfig() error
SendConfig sends endpoint config to HC GW
func (HumidityEndpoint) SendFeedbackMessage ¶
SendFeedbackMessage sends feedback message to HC GW when some of the commands change state
func (*HumidityEndpoint) SendStatus ¶
func (obj *HumidityEndpoint) SendStatus() error
func (HumidityEndpoint) SetOwnerID ¶
func (obj HumidityEndpoint) SetOwnerID(id string)
SetOwnerID sets endpoint's owner ID (device ID)
type IdentifyEndpoint ¶
type IdentifyEndpoint struct {
// contains filtered or unexported fields
}
func NewIdentifyEndpoint ¶
func (IdentifyEndpoint) GetID ¶
func (obj IdentifyEndpoint) GetID() string
GetID returns endpoint ID
func (IdentifyEndpoint) GetOwnerID ¶
func (obj IdentifyEndpoint) GetOwnerID() string
GetOwnerID returns owner ID
func (IdentifyEndpoint) HandleMessage ¶
HandleMessage handles incoming message
func (IdentifyEndpoint) RegisterOnStateChangedCb ¶
func (obj IdentifyEndpoint) RegisterOnStateChangedCb(cb func(ep Endpoint, cmd string, state string, err error))
RegisterOnStateChangedCb registers callback funkcion that is called when endpoint state is changed
func (IdentifyEndpoint) RegisterSendMsgCb ¶
RegisterSendMsgCb registers callback function that is called when message from endpoint must be sent to HC GW
func (IdentifyEndpoint) SendConfig ¶
func (obj IdentifyEndpoint) SendConfig() error
SendConfig sends endpoint config to HC GW
func (IdentifyEndpoint) SendFeedbackMessage ¶
SendFeedbackMessage sends feedback message to HC GW when some of the commands change state
func (*IdentifyEndpoint) SendStatus ¶
func (obj *IdentifyEndpoint) SendStatus() error
func (IdentifyEndpoint) SetOwnerID ¶
func (obj IdentifyEndpoint) SetOwnerID(id string)
SetOwnerID sets endpoint's owner ID (device ID)
type LevelEndpoint ¶
type LevelEndpoint struct {
// contains filtered or unexported fields
}
func NewLevelEndpoint ¶
func (LevelEndpoint) GetOwnerID ¶
func (obj LevelEndpoint) GetOwnerID() string
GetOwnerID returns owner ID
func (LevelEndpoint) HandleMessage ¶
HandleMessage handles incoming message
func (LevelEndpoint) RegisterOnStateChangedCb ¶
func (obj LevelEndpoint) RegisterOnStateChangedCb(cb func(ep Endpoint, cmd string, state string, err error))
RegisterOnStateChangedCb registers callback funkcion that is called when endpoint state is changed
func (LevelEndpoint) RegisterSendMsgCb ¶
RegisterSendMsgCb registers callback function that is called when message from endpoint must be sent to HC GW
func (LevelEndpoint) SendConfig ¶
func (obj LevelEndpoint) SendConfig() error
SendConfig sends endpoint config to HC GW
func (LevelEndpoint) SendFeedbackMessage ¶
SendFeedbackMessage sends feedback message to HC GW when some of the commands change state
func (*LevelEndpoint) SendStatus ¶
func (obj *LevelEndpoint) SendStatus() error
func (LevelEndpoint) SetOwnerID ¶
func (obj LevelEndpoint) SetOwnerID(id string)
SetOwnerID sets endpoint's owner ID (device ID)
type MotionEndpoint ¶
type MotionEndpoint struct {
// contains filtered or unexported fields
}
func NewMotionEndpoint ¶
func (MotionEndpoint) GetOwnerID ¶
func (obj MotionEndpoint) GetOwnerID() string
GetOwnerID returns owner ID
func (MotionEndpoint) HandleMessage ¶
HandleMessage handles incoming message
func (MotionEndpoint) RegisterOnStateChangedCb ¶
func (obj MotionEndpoint) RegisterOnStateChangedCb(cb func(ep Endpoint, cmd string, state string, err error))
RegisterOnStateChangedCb registers callback funkcion that is called when endpoint state is changed
func (MotionEndpoint) RegisterSendMsgCb ¶
RegisterSendMsgCb registers callback function that is called when message from endpoint must be sent to HC GW
func (MotionEndpoint) SendConfig ¶
func (obj MotionEndpoint) SendConfig() error
SendConfig sends endpoint config to HC GW
func (MotionEndpoint) SendFeedbackMessage ¶
SendFeedbackMessage sends feedback message to HC GW when some of the commands change state
func (*MotionEndpoint) SendStatus ¶
func (obj *MotionEndpoint) SendStatus() error
func (MotionEndpoint) SetOwnerID ¶
func (obj MotionEndpoint) SetOwnerID(id string)
SetOwnerID sets endpoint's owner ID (device ID)
type OnOffEndpoint ¶
type OnOffEndpoint struct {
// contains filtered or unexported fields
}
func NewOnOffEndpoint ¶
func (OnOffEndpoint) GetOwnerID ¶
func (obj OnOffEndpoint) GetOwnerID() string
GetOwnerID returns owner ID
func (OnOffEndpoint) HandleMessage ¶
HandleMessage handles incoming message
func (OnOffEndpoint) RegisterOnStateChangedCb ¶
func (obj OnOffEndpoint) RegisterOnStateChangedCb(cb func(ep Endpoint, cmd string, state string, err error))
RegisterOnStateChangedCb registers callback funkcion that is called when endpoint state is changed
func (OnOffEndpoint) RegisterSendMsgCb ¶
RegisterSendMsgCb registers callback function that is called when message from endpoint must be sent to HC GW
func (OnOffEndpoint) SendConfig ¶
func (obj OnOffEndpoint) SendConfig() error
SendConfig sends endpoint config to HC GW
func (OnOffEndpoint) SendFeedbackMessage ¶
SendFeedbackMessage sends feedback message to HC GW when some of the commands change state
func (*OnOffEndpoint) SendStatus ¶
func (obj *OnOffEndpoint) SendStatus() error
func (OnOffEndpoint) SetOwnerID ¶
func (obj OnOffEndpoint) SetOwnerID(id string)
SetOwnerID sets endpoint's owner ID (device ID)
type TemperatureEndpoint ¶
type TemperatureEndpoint struct {
// contains filtered or unexported fields
}
func NewTemperatureEndpoint ¶
func (TemperatureEndpoint) GetID ¶
func (obj TemperatureEndpoint) GetID() string
GetID returns endpoint ID
func (TemperatureEndpoint) GetOwnerID ¶
func (obj TemperatureEndpoint) GetOwnerID() string
GetOwnerID returns owner ID
func (TemperatureEndpoint) HandleMessage ¶
HandleMessage handles incoming message
func (TemperatureEndpoint) RegisterOnStateChangedCb ¶
func (obj TemperatureEndpoint) RegisterOnStateChangedCb(cb func(ep Endpoint, cmd string, state string, err error))
RegisterOnStateChangedCb registers callback funkcion that is called when endpoint state is changed
func (TemperatureEndpoint) RegisterSendMsgCb ¶
RegisterSendMsgCb registers callback function that is called when message from endpoint must be sent to HC GW
func (TemperatureEndpoint) SendConfig ¶
func (obj TemperatureEndpoint) SendConfig() error
SendConfig sends endpoint config to HC GW
func (TemperatureEndpoint) SendFeedbackMessage ¶
SendFeedbackMessage sends feedback message to HC GW when some of the commands change state
func (*TemperatureEndpoint) SendStatus ¶
func (obj *TemperatureEndpoint) SendStatus() error
func (TemperatureEndpoint) SetOwnerID ¶
func (obj TemperatureEndpoint) SetOwnerID(id string)
SetOwnerID sets endpoint's owner ID (device ID)
type ThermostatEndpoint ¶
type ThermostatEndpoint struct {
// contains filtered or unexported fields
}
func NewThermostatEndpoint ¶
func (ThermostatEndpoint) GetID ¶
func (obj ThermostatEndpoint) GetID() string
GetID returns endpoint ID
func (ThermostatEndpoint) GetOwnerID ¶
func (obj ThermostatEndpoint) GetOwnerID() string
GetOwnerID returns owner ID
func (ThermostatEndpoint) HandleMessage ¶
HandleMessage handles incoming message
func (ThermostatEndpoint) RegisterOnStateChangedCb ¶
func (obj ThermostatEndpoint) RegisterOnStateChangedCb(cb func(ep Endpoint, cmd string, state string, err error))
RegisterOnStateChangedCb registers callback funkcion that is called when endpoint state is changed
func (ThermostatEndpoint) RegisterSendMsgCb ¶
RegisterSendMsgCb registers callback function that is called when message from endpoint must be sent to HC GW
func (ThermostatEndpoint) SendConfig ¶
func (obj ThermostatEndpoint) SendConfig() error
SendConfig sends endpoint config to HC GW
func (ThermostatEndpoint) SendFeedbackMessage ¶
SendFeedbackMessage sends feedback message to HC GW when some of the commands change state
func (*ThermostatEndpoint) SendStatus ¶
func (obj *ThermostatEndpoint) SendStatus() error
func (ThermostatEndpoint) SetOwnerID ¶
func (obj ThermostatEndpoint) SetOwnerID(id string)
SetOwnerID sets endpoint's owner ID (device ID)
type ZeroEndpoint ¶
type ZeroEndpoint struct {
// contains filtered or unexported fields
}
func NewZeroEndpoint ¶
func (*ZeroEndpoint) HandleMessage ¶
func (obj *ZeroEndpoint) HandleMessage(msg string)
func (*ZeroEndpoint) SendConfig ¶
func (obj *ZeroEndpoint) SendConfig(enpCount int) error