-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlight_accessors.go
98 lines (83 loc) · 1.22 KB
/
light_accessors.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
package hue
func (l *Light) GetID() int {
return l.ID
}
func (l *Light) GetName() string {
if l == nil {
return ""
}
return l.Name
}
func (l *Light) GetType() string {
if l == nil {
return ""
}
return l.Type
}
// State
func (l *Light) IsOn() bool {
if l == nil {
return false
}
return l.State.On
}
func (l *Light) GetEffect() string {
if l == nil {
return ""
}
return l.State.Effect
}
func (l *Light) GetBri() uint8 {
if l == nil {
return 0
}
return l.State.Bri
}
func (l *Light) GetSat() uint8 {
if l == nil {
return 0
}
return l.State.Sat
}
func (l *Light) GetCT() uint16 {
if l == nil {
return 0
}
return l.State.CT
}
func (l *Light) GetXY() []float32 {
if l == nil {
return []float32{}
}
return l.State.XY
}
func (l *Light) GetAlert() string {
if l == nil {
return ""
}
return l.State.Alert
}
func (l *Light) GetTransitionTime() uint16 {
if l == nil {
return 0
}
return l.State.TransitionTime
}
func (l *Light) IsReachable() bool {
if l == nil {
return false
}
return l.State.Reachable
}
func (l *Light) GetColorMode() string {
if l == nil {
return ""
}
return l.State.ColorMode
}
func (l *Light) GetMode() string {
if l == nil {
return ""
}
return l.State.Mode
}