Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) Auth(username string) (psk string, err error)
- func (c *Client) GetDevice(id int) (d Device, err error)
- func (c *Client) GetGroup(id int) (g Group, err error)
- func (c *Client) ListDevices() ([]Device, error)
- func (c *Client) ListGroups() ([]Group, error)
- func (c *Client) SetLightControlDimmer(root, id int, dimmer int, transition time.Duration) error
- func (c *Client) SetLightControlMireds(root, id int, mireds int, transition time.Duration) error
- func (c *Client) SetLightControlState(root, id int, on bool) error
- type Device
- type Group
- type LightControl
- type LightControlInput
- type OnOff
- type Percent100
- type Percent255
- type PowerSource
- type Resource
- type SetGroupProperties
- type Timestamp
- type YesNo
Constants ¶
View Source
const ( RootDevices = 15001 RootGroups = 15004 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) ListDevices ¶
func (*Client) ListGroups ¶
func (*Client) SetLightControlDimmer ¶
func (*Client) SetLightControlMireds ¶
type Device ¶
type Device struct { Resource DeviceInfo struct { Manufacturer string `json:"0"` Model string `json:"1"` Serial string `json:"2"` Firmware string `json:"3"` PowerSource PowerSource `json:"6"` BatteryLevel Percent100 `json:"9"` } `json:"3"` LastSeen Timestamp `json:"9020"` Reachable YesNo `json:"9019"` LightControl []LightControl `json:"3311"` }
type Group ¶
type LightControl ¶
type LightControlInput ¶
type LightControlInput struct { State *OnOff `json:"5850,omitempty"` Dimmer *Percent255 `json:"5851,omitempty"` LightColorHex *string `json:"5706,omitempty"` LightColorX *int `json:"5709,omitempty"` LightColorY *int `json:"5710,omitempty"` LightMireds *int `json:"5711,omitempty"` Transition *int `json:"5712,omitempty"` }
type Percent100 ¶
type Percent100 int
func (Percent100) String ¶
func (p Percent100) String() string
type Percent255 ¶
type Percent255 int
func (Percent255) String ¶
func (p Percent255) String() string
type PowerSource ¶
type PowerSource int
func (PowerSource) String ¶
func (ps PowerSource) String() string
type SetGroupProperties ¶
Click to show internal directories.
Click to hide internal directories.