Documentation ¶
Index ¶
- Constants
- type CallServiceTarget
- type Client
- func (c *Client) AddEventHandler(eventType string, handler EventHandler) error
- func (c *Client) CallService(domain string, service string, serviceData map[string]interface{}, ...) error
- func (c *Client) Close() error
- func (c *Client) GetStates() ([]State, error)
- func (c *Client) Open() error
- func (c *Client) WaitAuth() error
- type ErrPriorToAuth
- type EventData
- type EventHandler
- type State
- type StateChangeEvent
- type StateChangeEventHandler
- type StateChangeHandler
Constants ¶
View Source
const (
EventStateChanged string = "state_changed"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CallServiceTarget ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddEventHandler ¶
func (c *Client) AddEventHandler(eventType string, handler EventHandler) error
func (*Client) CallService ¶
type ErrPriorToAuth ¶
type ErrPriorToAuth struct {
// contains filtered or unexported fields
}
type EventData ¶
type EventData struct { Data json.RawMessage `json:"data"` EventType string `json:"event_type"` }
type EventHandler ¶
type EventHandler interface {
OnEvent(eventData *EventData)
}
type StateChangeEvent ¶
type StateChangeEventHandler ¶
type StateChangeEventHandler struct {
// contains filtered or unexported fields
}
func NewStateChangeEventHandler ¶
func NewStateChangeEventHandler(client *Client) (*StateChangeEventHandler, error)
func (*StateChangeEventHandler) AddHandler ¶
func (c *StateChangeEventHandler) AddHandler(entityID string, handler StateChangeHandler)
func (*StateChangeEventHandler) OnEvent ¶
func (c *StateChangeEventHandler) OnEvent(eventData *EventData)
func (*StateChangeEventHandler) SetDefaultHandler ¶
func (c *StateChangeEventHandler) SetDefaultHandler(handler StateChangeHandler)
type StateChangeHandler ¶
type StateChangeHandler interface {
OnStateChange(event *StateChangeEvent)
}
Click to show internal directories.
Click to hide internal directories.