Documentation ¶
Index ¶
- type Command
- type Light
- func (m *Light) PowerOff(duration int) (string, error)
- func (m *Light) PowerOn(duration int) (string, error)
- func (m *Light) SendCommand(cmd Command) (string, error)
- func (m *Light) SetBrightness(level, duration int) (string, error)
- func (m *Light) SetRGB(red, green, blue, duration int) (string, error)
- func (m *Light) SetTemp(temp, duration int) (string, error)
- func (m *Light) Toggle() (string, error)
- func (m *Light) Update() error
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct { ID int32 `json:"id"` Method string `json:"method"` Params interface{} `json:"params"` }
Command to send to the light
type Light ¶
type Light struct { Location string `json:"location,omitempty"` ID string `json:"id,omitempty"` Model string `json:"model,omitempty"` FWVersion int `json:"fw_ver,omitempty"` Support []string `json:"support,omitempty"` Power string `json:"power,omitempty"` Bright int `json:"bright,omitempty"` ColorMode int `json:"color_mode,omitempty"` ColorTemp int `json:"ct,omitempty"` RGB int `json:"rgb,omitempty"` Hue int `json:"hue,omitempty"` Saturation int `json:"sat,omitempty"` Name string `json:"name,omitempty"` }
Light properties
func (*Light) SendCommand ¶
SendCommand sends a single command to the light
func (*Light) SetBrightness ¶
SetBrightness takes the brightness (0-100), transition duration and set brightness of the light
func (*Light) SetRGB ¶
SetRGB takes r, g, b values (0-255), transition duration and set color of the light
func (*Light) SetTemp ¶
SetTemp takes temperature values (1700-6500K), transition duration and set color temperature of the light
Click to show internal directories.
Click to hide internal directories.