forked from vapourismo/knx-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types_20.go
107 lines (94 loc) · 1.72 KB
/
types_20.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
99
100
101
102
103
104
105
106
107
package dpt
const (
HVACMode_Auto DPT_20102 = iota
HVACMode_Comfort
HVACMode_Standby
HVACMode_Economy
HVACMode_BuildingProtection
)
// DPT_20102 represents DPT 20.102 / HVAC Mode.
type DPT_20102 uint8
func (d DPT_20102) Pack() []byte {
return packU8(uint8(d))
}
func (d *DPT_20102) Unpack(data []byte) error {
return unpackU8(data, (*uint8)(d))
}
func (d DPT_20102) Unit() string {
return ""
}
func (d DPT_20102) String() string {
switch d {
case HVACMode_Auto:
return "Auto"
case HVACMode_Comfort:
return "Comfort"
case HVACMode_Standby:
return "Standby"
case HVACMode_Economy:
return "Economy"
case HVACMode_BuildingProtection:
return "Building Protection"
default:
return "reserved"
}
}
// DPT_20105 represents DPT 20.105 / HVACContrMode.
type DPT_20105 uint8
func (d DPT_20105) Pack() []byte {
return packU8(uint8(d))
}
func (d *DPT_20105) Unpack(data []byte) error {
var value uint8
if err := unpackU8(data, &value); err != nil {
return err
}
*d = DPT_20105(value)
return nil
}
func (d DPT_20105) Unit() string {
return ""
}
func (d DPT_20105) String() string {
switch d {
case 0:
return "Auto"
case 1:
return "Heat"
case 2:
return "Morning Warmup"
case 3:
return "Cool"
case 4:
return "Night Purge"
case 5:
return "Precool"
case 6:
return "Off"
case 7:
return "Test"
case 8:
return "Emergency Heat"
case 9:
return "Fan only"
case 10:
return "Free Cool"
case 11:
return "Ice"
case 12:
return "Maximum Heating Mode"
case 13:
return "Economic Heat/Cool Mode"
case 14:
return "Dehumidification"
case 15:
return "Calibration Mode"
case 16:
return "Emergency Cool Mode"
case 17:
return "Emergency Steam Mode"
case 20:
return "NoDem"
}
return "reserved"
}