-
Notifications
You must be signed in to change notification settings - Fork 2
/
scenes.go
56 lines (44 loc) · 1019 Bytes
/
scenes.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package yeelight
type Scene interface {
toParams() params
}
type BaseScene struct {
name string
}
type ColorScene struct {
BaseScene
rgb, brightness int
}
func (s ColorScene) toParams() params {
return params{s.name, s.rgb, s.brightness}
}
type HSVScene struct {
BaseScene
hue, saturation, brightness int
}
func (s HSVScene) toParams() params {
return params{s.name, s.hue, s.saturation, s.brightness}
}
type TemperatureScene struct {
BaseScene
temperature, brightness int
}
func (s TemperatureScene) toParams() params {
return params{s.name, s.temperature, s.brightness}
}
type ColorFlowScene struct {
BaseScene
count, action int
flowExpression FlowExpression
}
func (s ColorFlowScene) toParams() params {
return params{s.name, s.count, s.action, s.flowExpression}
}
// automatic shutdown after specified amount of minutes
type AutoDelayOffScene struct {
BaseScene
brightness, minutes int
}
func (s AutoDelayOffScene) toParams() params {
return params{s.name, s.brightness, s.minutes}
}