diff options
author | realytcracker <rapper@gmail.com> | 2017-03-07 03:02:07 -0800 |
---|---|---|
committer | realytcracker <rapper@gmail.com> | 2017-03-07 03:02:07 -0800 |
commit | 912d5c888433640821d4c96239e560e30151e644 (patch) | |
tree | 6c760d3fc21d6bc0bd0399c317378008b82e4c6f | |
parent | 89c577f1d6c3d7ce773d077fcfc5c76a7bdc0ab0 (diff) |
added SetColorHS, SetColorXY as alias of SetColor
-rw-r--r-- | light.go | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -173,6 +173,24 @@ func (light *Light) SetColor(color *[2]float32) error { return nil } +// SetColorXY requires a selection from the above light +// color variable section and sets the light to that XY HSL color +// aliased for clarity +func (light *Light) SetColorXY(color *[2]float32) { + light.SetColor(color) +} + +// SetColorHS requires a selection from the above light +// color variable section and sets the light to the Hue value +func (light *Light) SetColorHS(color uint16) error { + lightState := LightState{On: true, Hue: color} + err := light.SetState(lightState) + if err != nil { + return err + } + return nil +} + // Dim lowers the brightness by a percent. // Note the required value is an integer, for example "20" is converted to 20%. func (light *Light) Dim(percent int) error { |