diff options
Diffstat (limited to 'light.go')
-rw-r--r-- | light.go | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -49,6 +49,14 @@ type LightState struct { XYIncrement *[2]float32 `json:"xy_inc,omitempty"` } +func (self *Light) TurnOff() { + SetLightState(self.Index, LightState{On: false}) +} + +func (self *Light) TurnOn() { + SetLightState(self.Index, LightState{On: true}) +} + // SetLightState will modify light attributes such as on/off, saturation, // brightness, and more. See `SetLightState` struct. func SetLightState(bridge *Bridge, index int, newState LightState) error { |