Documentation ¶
Index ¶
Constants ¶
View Source
const ( // SyncIntent is used when syncing devices. SyncIntent = "action.devices.SYNC" // QueryIntent is used when querying for status. QueryIntent = "action.devices.QUERY" // ExecuteIntent is used when controlling devices. ExecuteIntent = "action.devices.EXECUTE" CommandBrightnessAbsolute = "action.devices.commands.BrightnessAbsolute" CommandOnOff = "action.devices.commands.OnOff" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct { ID string `json:"id"` Type string `json:"type"` Traits []string `json:"traits"` Name DeviceName `json:"name"` WillReportState bool `json:"willReportState"` // DeviceInfo struct { // Manufacturer string `json:"manufacturer"` // Model string `json:"model"` // HwVersion string `json:"hwVersion"` // SwVersion string `json:"swVersion"` // } `json:"deviceInfo"` // CustomData struct { // FooValue int `json:"fooValue"` // BarValue bool `json:"barValue"` // BazValue string `json:"bazValue"` // } `json:"customData"` Attributes DeviceAttributes `json:"attributes,omitempty"` }
type DeviceAttributes ¶
type DeviceName ¶
type Payload ¶
type Payload struct { Commands []struct { Devices []struct { ID string `json:"id"` } `json:"devices"` Execution []struct { Command string `json:"command"` Params struct { On bool `json:"on"` Brightness int `json:"brightness"` } `json:"params"` } `json:"execution"` } `json:"commands"` Devices []struct { ID string `json:"id"` } `json:"devices"` }
type QueryResponse ¶
type Response ¶
type Response struct { RequestID string `json:"requestId"` Payload struct { AgentUserID string `json:"agentUserId,omitempty"` Devices []Device `json:"devices,omitempty"` Commands []ResponseCommand `json:"commands,omitempty"` } `json:"payload"` }
type ResponseCommand ¶
type ResponseCommand struct { IDs []string `json:"ids"` Status string `json:"status"` States ResponseStates `json:"states"` ErrorCode string `json:"errorCode,omitempty"` }
func NewResponseCommand ¶
func NewResponseCommand() ResponseCommand
type ResponseStates ¶
Click to show internal directories.
Click to hide internal directories.