forked from brutella/hc
/
light_bulb.go
39 lines (29 loc) · 1.16 KB
/
light_bulb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package model
// A LightBulb is a Switch and additionally has a brightness, saturation and hue value.
//
// TODO(brutella): The HAP protocol defines brightness, saturation and hue as optional. This
// is currently no reflected in the LightBulb interface yet.
type LightBulb interface {
Switch
// OnBrightnessChanged sets the brightness changed callback
OnBrightnessChanged(func(int))
// OnHueChanged sets the hue changed callback
OnHueChanged(func(float64))
// OnSaturationChanged sets the saturation changed callback
OnSaturationChanged(func(float64))
// GetBrightness returns the light bulb's brightness between 0 and 100
GetBrightness() int
// SetBrightness sets the light bulb's brightness
// The argument should be between 0 and 100
SetBrightness(int)
// GetHue returns the light bulb's hue between 0.0 and 360.0
GetHue() float64
// SetHue sets the light bulb's hue
// The argument should be between 0.0 and 360.0
SetHue(float64)
// GetSaturation returns the light bulb's saturation between 0.0 and 100.0
GetSaturation() float64
// SetSaturation sets the light bulb's saturation
// The argument should be between 0 and 100
SetSaturation(float64)
}