Documentation
¶
Index ¶
- type Attributes
- type AuthRequest
- type AuthResponse
- type BaseError
- type BaseMessage
- type BaseResult
- type EventContainer
- type EventResponse
- type MsgType
- type SensorState
- type StateResult
- type SubscribeStateRequest
- type TriggerContainer
- type TriggerDetails
- type UnsubscribeRequest
- type VariablesContainer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attributes ¶
type AuthRequest ¶
type AuthResponse ¶
type BaseMessage ¶
func (*BaseMessage) SetId ¶
func (r *BaseMessage) SetId(seq uint64)
type BaseResult ¶
type BaseResult struct { BaseMessage Success *bool `json:"success"` Error *BaseError `json:"error"` }
type EventContainer ¶
type EventContainer struct {
Variables VariablesContainer `json:"variables"`
}
type EventResponse ¶
type EventResponse struct { BaseMessage Event EventContainer `json:"event"` }
type MsgType ¶
type MsgType string
const ( AuthRequired MsgType = "auth_required" Auth MsgType = "auth" AuthOk MsgType = "auth_ok" AuthInvalid MsgType = "auth_invalid" Result MsgType = "result" SubscribeEvents MsgType = "subscribe_events" Event MsgType = "event" SubscribeTrigger MsgType = "subscribe_trigger" UnsubscribeEvents MsgType = "unsubscribe_events" FireEvent MsgType = "fire_event" CallService MsgType = "call_service" GetStates MsgType = "get_states" GetConfig MsgType = "get_config" GetServices MsgType = "get_services" GetPanels MsgType = "get_panels" MediaPlayerThumbnail MsgType = "media_player_thumbnail" Ping MsgType = "ping" Pong MsgType = "pong" ValidateConfig MsgType = "validate_config" )
type SensorState ¶
type SensorState struct { Attributes Attributes `json:"attributes"` EntityID string `json:"entity_id"` State string `json:"state"` }
type StateResult ¶
type StateResult struct { BaseResult Result []SensorState `json:"result"` }
func (*StateResult) GetEntityIdWithPrefixAndType ¶
func (s *StateResult) GetEntityIdWithPrefixAndType(prefix string, stype string) string
type SubscribeStateRequest ¶
type SubscribeStateRequest struct { BaseMessage Trigger TriggerDetails `json:"trigger"` }
type TriggerContainer ¶
type TriggerContainer struct { Platform string `json:"platform"` EntityID string `json:"entity_id"` FromState SensorState `json:"from_state"` ToState SensorState `json:"to_state"` }
type TriggerDetails ¶
type UnsubscribeRequest ¶
type UnsubscribeRequest struct { BaseMessage Subscription uint64 `json:"subscription"` }
type VariablesContainer ¶
type VariablesContainer struct {
Trigger TriggerContainer `json:"trigger"`
}
Click to show internal directories.
Click to hide internal directories.