forked from gvigroux/hon
-
Notifications
You must be signed in to change notification settings - Fork 1
/
const.py
280 lines (244 loc) · 5.92 KB
/
const.py
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
"""hOn component constants."""
from enum import IntEnum
from homeassistant.components.climate.const import (
FAN_AUTO,
FAN_LOW,
FAN_MEDIUM,
FAN_HIGH,
SWING_OFF,
SWING_BOTH,
SWING_VERTICAL,
SWING_HORIZONTAL,
HVACMode,
)
DOMAIN = "hon"
# to store the cookie
STORAGE_KEY = DOMAIN
STORAGE_VERSION = 1
CONF_ID_TOKEN = "token"
CONF_COGNITO_TOKEN = "cognito_token"
CONF_REFRESH_TOKEN = "refresh_token"
CONF_FRAMEWORK = "framework"
PLATFORMS = [
"climate",
"sensor",
"binary_sensor"
]
class APPLIANCE_TYPE(IntEnum):
WASHING_MACHINE = 1,
WASH_DRYER = 2,
OVEN = 4,
WINE_COOLER = 6,
PURIFIER = 7,
TUMBLE_DRYER = 8,
DISH_WASHER = 9,
CLIMATE = 11,
FRIDGE = 14
APPLIANCE_DEFAULT_NAME = {
"1": "Washing Machine",
"2": "Wah Dryer",
"4": "Oven",
"6": "Wine Cooler",
"7": "Purifier",
"8": "Tumble Dryer",
"9": "Dish Washer",
"11": "Climate",
"14": "Fridge",
}
class ClimateFanMode(IntEnum):
HON_FAN_OFF = 0
HON_FAN_AUTO = 5
HON_FAN_LOW = 3
HON_FAN_MEDIUM = 2
HON_FAN_HIGH = 1
class ClimateHvacMode(IntEnum):
HON_HVAC_AUTO = 0
HON_HVAC_COOL = 1
HON_HVAC_DRY = 2
HON_HVAC_HEAT = 4
HON_HVAC_FAN_ONLY = 6
CLIMATE_MODE = {
"0": "Auto",
"1": "Cool",
"2": "Dry",
"4": "Heat",
"6": "Fan only",
}
class ClimateSwingVertical(IntEnum):
AUTO = 8
VERY_LOW = 7
LOW = 6
MIDDLE = 5
HIGH = 4
HEALTH_LOW = 3
VERY_HIGH = 2
HEALTH_HIGH = 1
class ClimateSwingHorizontal(IntEnum):
AUTO = 7
MIDDLE = 0
FAR_LEFT = 3
LEFT = 4
RIGHT = 5
FAR_RIGHT = 6
CLIMATE_FAN_MODE = {
FAN_LOW: ClimateFanMode.HON_FAN_LOW.value,
FAN_MEDIUM: ClimateFanMode.HON_FAN_MEDIUM.value,
FAN_HIGH: ClimateFanMode.HON_FAN_HIGH.value,
FAN_AUTO: ClimateFanMode.HON_FAN_AUTO.value,
}
CLIMATE_HVAC_MODE = {
HVACMode.AUTO: ClimateHvacMode.HON_HVAC_AUTO,
HVACMode.COOL: ClimateHvacMode.HON_HVAC_COOL,
HVACMode.HEAT: ClimateHvacMode.HON_HVAC_HEAT,
HVACMode.DRY: ClimateHvacMode.HON_HVAC_DRY,
HVACMode.FAN_ONLY: ClimateHvacMode.HON_HVAC_FAN_ONLY,
}
CLIMATE_SWING_MODE_HORIZONTAL = {
SWING_OFF: ClimateSwingHorizontal.MIDDLE,
SWING_BOTH: ClimateSwingHorizontal.AUTO,
SWING_HORIZONTAL: ClimateSwingHorizontal.AUTO,
SWING_VERTICAL: ClimateSwingHorizontal.MIDDLE,
}
OVEN_PROGRAMS = {
"3": "Botton",
"4": "Bottom + fan",
"6": "Convection + fan",
"5": "Convectional",
"10": "Taylor Bake",
"23": "Multi-level",
"54": "Soft+"
}
WASHING_MACHINE_DOOR_LOCK_STATUS = {
"1": "Locked",
"0": "Unlocked"
}
WASHING_MACHINE_ERROR_CODES = {
"00": "No error",
#"E1": "Error E1: Check the filter of the washing machine",
"100000000000": "E2: Check if the door is closed",
"8000000000000": "E4: Check the water supply",
#"CLRF": "Error Clear Filter: Check the filter of the washing machine",
"400000000000000": "Error Unb: Check the laundry, the washing machine might be overloaded",
#"F3": "Error F3: Temperature sensor error",
#"F4": "Error F4: Heating error",
#"F7": "Error F7: Motor error",
#"FA": "Error FA: Water level sensor error",
#"FC0": "Error FC0: Communication error",
#"FC1": "Error FC1: Communication error",
#"FC2": "Error FC2: Communication error"
}
WASHING_MACHINE_MODE = {
"0": "Disconnected",
"1": "Ready",
"2": "Running",
"3": "Paused",
"5": "Scheduled",
"6": "Error",
"7": "Finished"
}
WASHING_MACHINE_PROGRAM = {
"0": {
"name": "fragile",
"spinSpeed": "400",
"temp": "30",
"rinseIterations": "1",
"mainWashTime": "10",
"autoSoftenerStatus": "1"
},
"1": {
"name": "quotidien sale",
"spinSpeed": "1400",
"temp": "40",
"rinseIterations": "2",
"mainWashTime": "15",
"autoSoftenerStatus": "1"
},
}
DISH_WASHER_MODE = {
"1": "Ready",
"2": "Running",
"3": "Delayed start",
"5": "Delayed start cancelled",
"7": "Finished",
"9": "XXXXXX"
}
##some programs share id but parameters (T, W, time) might be differnet. Task develop parameter adjustment
DISH_WASHER_PROGRAMS = {
"1": "program1",
"2": "program2",
"3": "Strong & Fast",
"4": "program4",
"5": "Dinner for 2",
"6": "program6",
"7": "program7",
"8": "Eco 45ºC", ##happy hour, plastic & tupperware (75ºC & more water usage)
"9": "Crystal", ##delicate 45ºC
"10": "Class A 59' 65ºC", ##Pirex & Glassware
"11": "Fast 29' 50ºC",
"12": "Rinse",
"13": "Crystal 45ºC",
"14": "Auto Universal 65-75ºC",
"15": "Auto Universal 50-60ºC", ##daily, special for pots
"16": "Auto Sensor", ##dinner for 2, coctail glasses
"17": "Ultra Silence 55ºC",
"21": "Breakfast", #fast 39' 60ºC
"22": "Sanitizing cycle",
"23": "Baby Care", #super cleaning, vapor plus 75ºC
"24": "Hygiene+ 75ºC",
}
TUMBLE_DRYER_MODE = {
"1": "Ready",
"2": "Running",
"7": "Finished"
}
TUMBLE_DRYER_PROGRAMS = {
"0": "Default",
"62": "Cotton",
"63": "Synthetics",
"64": "Mix",
"66": "Bed Sheets",
"72": "Sports",
"74": "i-time",
"75": "Duvet",
"76": "Wool",
"78": "i-Refresh",
"83": "Towel",
"85": "Quick Dry",
"92": "Delicate",
"103": "Remote 103"
}
TUMBLE_DRYER_PROGRAMS_PHASE = {
"0": "Waiting",
"2": "Drying",
"3": "Cooldown",
"11": "11"
}
TUMBLE_DRYER_DRYL = {
"3": "Cupboard dry",
"12": "Ready to Iron H-3",
"13": "Ready to Store H-2",
"14": "Extra Dry H-1"
}
TUMBLE_DRYER_TEMPL = {
"1": "Cool",
"2": "Low temperature L-1",
"3": "Middle temperature L-2",
"4": "High temperature L-3"
}
PURIFIER_MODE = {
"0": "Off",
"1": "Sleep",
"2": "Auto",
"4": "Max"
}
PURIFIER_VOC_VALUE = {
"1": "Good",
"2": "Moderate",
"3": "Mediocre",
"4": "Bad"
}
PURIFIER_LIGHT_VALUE = {
"0": "Off",
"1": "50%",
"2": "100%"
}