homebridge-midea-platform 1.2.0-beta.8 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -2
- package/README.md +2 -2
- package/dist/accessory/AccessoryFactory.d.ts +14 -15
- package/dist/accessory/AccessoryFactory.js +34 -40
- package/dist/accessory/AccessoryFactory.js.map +1 -1
- package/dist/accessory/AirConditionerAccessory.d.ts +98 -99
- package/dist/accessory/AirConditionerAccessory.js +666 -662
- package/dist/accessory/AirConditionerAccessory.js.map +1 -1
- package/dist/accessory/BaseAccessory.d.ts +11 -12
- package/dist/accessory/BaseAccessory.js +21 -21
- package/dist/accessory/BaseAccessory.js.map +1 -1
- package/dist/accessory/DehumidifierAccessory.d.ts +45 -46
- package/dist/accessory/DehumidifierAccessory.js +343 -344
- package/dist/accessory/DehumidifierAccessory.js.map +1 -1
- package/dist/accessory/DishwasherAccessory.d.ts +30 -31
- package/dist/accessory/DishwasherAccessory.js +59 -63
- package/dist/accessory/DishwasherAccessory.js.map +1 -1
- package/dist/accessory/ElectricWaterHeaterAccessory.d.ts +44 -45
- package/dist/accessory/ElectricWaterHeaterAccessory.js +172 -176
- package/dist/accessory/ElectricWaterHeaterAccessory.js.map +1 -1
- package/dist/accessory/FanAccessory.d.ts +39 -40
- package/dist/accessory/FanAccessory.js +120 -123
- package/dist/accessory/FanAccessory.js.map +1 -1
- package/dist/accessory/FrontLoadWasherAccessory.d.ts +30 -31
- package/dist/accessory/FrontLoadWasherAccessory.js +63 -66
- package/dist/accessory/FrontLoadWasherAccessory.js.map +1 -1
- package/dist/accessory/GasWaterHeaterAccessory.d.ts +51 -52
- package/dist/accessory/GasWaterHeaterAccessory.js +217 -216
- package/dist/accessory/GasWaterHeaterAccessory.js.map +1 -1
- package/dist/accessory/{HeatPumpWifiControllerAccessory.d.ts → HeatPumpWiFiControllerAccessory.d.ts} +34 -35
- package/dist/accessory/{HeatPumpWifiControllerAccessory.js → HeatPumpWiFiControllerAccessory.js} +55 -36
- package/dist/accessory/HeatPumpWiFiControllerAccessory.js.map +1 -0
- package/dist/core/MideaCloud.d.ts +34 -36
- package/dist/core/MideaCloud.js +349 -350
- package/dist/core/MideaCloud.js.map +1 -1
- package/dist/core/MideaConstants.d.ts +51 -52
- package/dist/core/MideaConstants.js +56 -59
- package/dist/core/MideaConstants.js.map +1 -1
- package/dist/core/MideaDevice.d.ts +75 -78
- package/dist/core/MideaDevice.js +430 -420
- package/dist/core/MideaDevice.js.map +1 -1
- package/dist/core/MideaDiscover.d.ts +34 -36
- package/dist/core/MideaDiscover.js +208 -212
- package/dist/core/MideaDiscover.js.map +1 -1
- package/dist/core/MideaMessage.d.ts +75 -76
- package/dist/core/MideaMessage.js +185 -184
- package/dist/core/MideaMessage.js.map +1 -1
- package/dist/core/MideaPacketBuilder.d.ts +9 -11
- package/dist/core/MideaPacketBuilder.js +60 -60
- package/dist/core/MideaPacketBuilder.js.map +1 -1
- package/dist/core/MideaSecurity.d.ts +62 -64
- package/dist/core/MideaSecurity.js +241 -251
- package/dist/core/MideaSecurity.js.map +1 -1
- package/dist/core/MideaUtils.d.ts +31 -33
- package/dist/core/MideaUtils.js +178 -181
- package/dist/core/MideaUtils.js.map +1 -1
- package/dist/devices/DeviceFactory.d.ts +14 -15
- package/dist/devices/DeviceFactory.js +34 -40
- package/dist/devices/DeviceFactory.js.map +1 -1
- package/dist/devices/a1/MideaA1Device.d.ts +75 -77
- package/dist/devices/a1/MideaA1Device.js +142 -145
- package/dist/devices/a1/MideaA1Device.js.map +1 -1
- package/dist/devices/a1/MideaA1Message.d.ts +39 -41
- package/dist/devices/a1/MideaA1Message.js +219 -198
- package/dist/devices/a1/MideaA1Message.js.map +1 -1
- package/dist/devices/ac/MideaACDevice.d.ts +105 -107
- package/dist/devices/ac/MideaACDevice.js +417 -400
- package/dist/devices/ac/MideaACDevice.js.map +1 -1
- package/dist/devices/ac/MideaACMessage.d.ts +97 -96
- package/dist/devices/ac/MideaACMessage.js +724 -621
- package/dist/devices/ac/MideaACMessage.js.map +1 -1
- package/dist/devices/c3/MideaC3Device.d.ts +73 -75
- package/dist/devices/c3/MideaC3Device.js +249 -255
- package/dist/devices/c3/MideaC3Device.js.map +1 -1
- package/dist/devices/c3/MideaC3Message.d.ts +81 -80
- package/dist/devices/c3/MideaC3Message.js +190 -152
- package/dist/devices/c3/MideaC3Message.js.map +1 -1
- package/dist/devices/db/MideaDBDevice.d.ts +28 -30
- package/dist/devices/db/MideaDBDevice.js +94 -100
- package/dist/devices/db/MideaDBDevice.js.map +1 -1
- package/dist/devices/db/MideaDBMessage.d.ts +31 -33
- package/dist/devices/db/MideaDBMessage.js +101 -101
- package/dist/devices/db/MideaDBMessage.js.map +1 -1
- package/dist/devices/e1/MideaE1Device.d.ts +55 -57
- package/dist/devices/e1/MideaE1Device.js +122 -128
- package/dist/devices/e1/MideaE1Device.js.map +1 -1
- package/dist/devices/e1/MideaE1Message.d.ts +27 -29
- package/dist/devices/e1/MideaE1Message.js +128 -107
- package/dist/devices/e1/MideaE1Message.js.map +1 -1
- package/dist/devices/e2/MideaE2Device.d.ts +43 -45
- package/dist/devices/e2/MideaE2Device.js +124 -129
- package/dist/devices/e2/MideaE2Device.js.map +1 -1
- package/dist/devices/e2/MideaE2Message.d.ts +34 -34
- package/dist/devices/e2/MideaE2Message.js +143 -132
- package/dist/devices/e2/MideaE2Message.js.map +1 -1
- package/dist/devices/e3/MideaE3Device.d.ts +42 -44
- package/dist/devices/e3/MideaE3Device.js +132 -137
- package/dist/devices/e3/MideaE3Device.js.map +1 -1
- package/dist/devices/e3/MideaE3Message.d.ts +51 -52
- package/dist/devices/e3/MideaE3Message.js +144 -136
- package/dist/devices/e3/MideaE3Message.js.map +1 -1
- package/dist/devices/fa/MideaFADevice.d.ts +35 -37
- package/dist/devices/fa/MideaFADevice.js +102 -106
- package/dist/devices/fa/MideaFADevice.js.map +1 -1
- package/dist/devices/fa/MideaFAMessage.d.ts +38 -39
- package/dist/devices/fa/MideaFAMessage.js +108 -98
- package/dist/devices/fa/MideaFAMessage.js.map +1 -1
- package/dist/index.d.ts +6 -7
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/dist/platform.d.ts +61 -61
- package/dist/platform.js +232 -212
- package/dist/platform.js.map +1 -1
- package/dist/platformUtils.d.ts +116 -117
- package/dist/platformUtils.js +107 -110
- package/dist/platformUtils.js.map +1 -1
- package/dist/settings.d.ts +8 -9
- package/dist/settings.js +8 -11
- package/dist/settings.js.map +1 -1
- package/docs/download_lua.md +9 -0
- package/eslint.config.js +43 -0
- package/homebridge-ui/public/js/bootstrap.min.js +1179 -1
- package/homebridge-ui/{server.js → server.cjs} +30 -30
- package/package.json +21 -31
- package/.eslintignore +0 -3
- package/.husky/pre-commit +0 -5
- package/.prettierrc +0 -19
- package/dist/accessory/AccessoryFactory.d.ts.map +0 -1
- package/dist/accessory/AirConditionerAccessory.d.ts.map +0 -1
- package/dist/accessory/BaseAccessory.d.ts.map +0 -1
- package/dist/accessory/DehumidifierAccessory.d.ts.map +0 -1
- package/dist/accessory/DishwasherAccessory.d.ts.map +0 -1
- package/dist/accessory/ElectricWaterHeaterAccessory.d.ts.map +0 -1
- package/dist/accessory/FanAccessory.d.ts.map +0 -1
- package/dist/accessory/FrontLoadWasherAccessory.d.ts.map +0 -1
- package/dist/accessory/GasWaterHeaterAccessory.d.ts.map +0 -1
- package/dist/accessory/HeatPumpWifiControllerAccessory.d.ts.map +0 -1
- package/dist/accessory/HeatPumpWifiControllerAccessory.js.map +0 -1
- package/dist/core/MideaCloud.d.ts.map +0 -1
- package/dist/core/MideaConstants.d.ts.map +0 -1
- package/dist/core/MideaDevice.d.ts.map +0 -1
- package/dist/core/MideaDiscover.d.ts.map +0 -1
- package/dist/core/MideaMessage.d.ts.map +0 -1
- package/dist/core/MideaPacketBuilder.d.ts.map +0 -1
- package/dist/core/MideaSecurity.d.ts.map +0 -1
- package/dist/core/MideaUtils.d.ts.map +0 -1
- package/dist/devices/DeviceFactory.d.ts.map +0 -1
- package/dist/devices/a1/MideaA1Device.d.ts.map +0 -1
- package/dist/devices/a1/MideaA1Message.d.ts.map +0 -1
- package/dist/devices/ac/MideaACDevice.d.ts.map +0 -1
- package/dist/devices/ac/MideaACMessage.d.ts.map +0 -1
- package/dist/devices/c3/MideaC3Device.d.ts.map +0 -1
- package/dist/devices/c3/MideaC3Message.d.ts.map +0 -1
- package/dist/devices/db/MideaDBDevice.d.ts.map +0 -1
- package/dist/devices/db/MideaDBMessage.d.ts.map +0 -1
- package/dist/devices/e1/MideaE1Device.d.ts.map +0 -1
- package/dist/devices/e1/MideaE1Message.d.ts.map +0 -1
- package/dist/devices/e2/MideaE2Device.d.ts.map +0 -1
- package/dist/devices/e2/MideaE2Message.d.ts.map +0 -1
- package/dist/devices/e3/MideaE3Device.d.ts.map +0 -1
- package/dist/devices/e3/MideaE3Message.d.ts.map +0 -1
- package/dist/devices/fa/MideaFADevice.d.ts.map +0 -1
- package/dist/devices/fa/MideaFAMessage.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/platform.d.ts.map +0 -1
- package/dist/platformUtils.d.ts.map +0 -1
- package/dist/settings.d.ts.map +0 -1
|
@@ -1,663 +1,667 @@
|
|
|
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
|
-
this.
|
|
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
|
-
this.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
this.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
.
|
|
81
|
-
|
|
82
|
-
.
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
this.
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
this.
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
.
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
this.
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
this.fanService
|
|
123
|
-
.getCharacteristic(this.platform.Characteristic.
|
|
124
|
-
.onGet(this.
|
|
125
|
-
.onSet(this.
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
this.
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
.
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
this.
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
.
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
this.
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
.
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
this.
|
|
191
|
-
this.
|
|
192
|
-
|
|
193
|
-
.
|
|
194
|
-
.
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
this.
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
this.
|
|
216
|
-
this.
|
|
217
|
-
this.
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
this.
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
.
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
this.
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
.
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
this.
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
.
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
this.
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
:
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
this.
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
.
|
|
290
|
-
.
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
this.
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
this.
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
this.
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
.
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
break;
|
|
388
|
-
case '
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
}
|
|
437
|
-
async
|
|
438
|
-
await this.device.set_attribute({
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
return (
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
return this.device.attributes.POWER === true && this.device.attributes.
|
|
561
|
-
}
|
|
562
|
-
async
|
|
563
|
-
await this.device.set_attribute({
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
return this.device.attributes.POWER === true && this.device.attributes.
|
|
567
|
-
}
|
|
568
|
-
async
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
return this.device.attributes.
|
|
617
|
-
}
|
|
618
|
-
async
|
|
619
|
-
await this.device.
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
1
|
+
import BaseAccessory from './BaseAccessory.js';
|
|
2
|
+
import { SwingAngle, SwingMode } from '../platformUtils.js';
|
|
3
|
+
export default class AirConditionerAccessory extends BaseAccessory {
|
|
4
|
+
device;
|
|
5
|
+
configDev;
|
|
6
|
+
service;
|
|
7
|
+
outDoorTemperatureService;
|
|
8
|
+
displayService;
|
|
9
|
+
fanOnlyService;
|
|
10
|
+
fanService;
|
|
11
|
+
ecoModeService;
|
|
12
|
+
breezeAwayService;
|
|
13
|
+
dryModeService;
|
|
14
|
+
boostModeService;
|
|
15
|
+
auxService;
|
|
16
|
+
auxHeatingService;
|
|
17
|
+
selfCleanService;
|
|
18
|
+
ionService;
|
|
19
|
+
rateSelectService;
|
|
20
|
+
swingAngleService;
|
|
21
|
+
swingAngleMainControl;
|
|
22
|
+
/*********************************************************************
|
|
23
|
+
* Constructor registers all the service types with Homebridge, registers
|
|
24
|
+
* a callback function with the MideaDevice class, and requests device status.
|
|
25
|
+
*/
|
|
26
|
+
constructor(platform, accessory, device, configDev) {
|
|
27
|
+
super(platform, accessory, device, configDev);
|
|
28
|
+
this.device = device;
|
|
29
|
+
this.configDev = configDev;
|
|
30
|
+
this.service =
|
|
31
|
+
this.accessory.getService(this.platform.Service.HeaterCooler) || this.accessory.addService(this.platform.Service.HeaterCooler);
|
|
32
|
+
this.service.setCharacteristic(this.platform.Characteristic.Name, this.device.name);
|
|
33
|
+
this.service.getCharacteristic(this.platform.Characteristic.Active).onGet(this.getActive.bind(this)).onSet(this.setActive.bind(this));
|
|
34
|
+
this.service
|
|
35
|
+
.getCharacteristic(this.platform.Characteristic.TemperatureDisplayUnits)
|
|
36
|
+
.onGet(this.getTemperatureDisplayUnits.bind(this))
|
|
37
|
+
.onSet(this.setTemperatureDisplayUnits.bind(this));
|
|
38
|
+
this.service
|
|
39
|
+
.getCharacteristic(this.platform.Characteristic.CurrentHeaterCoolerState)
|
|
40
|
+
.onGet(this.getCurrentHeaterCoolerState.bind(this));
|
|
41
|
+
this.service
|
|
42
|
+
.getCharacteristic(this.platform.Characteristic.TargetHeaterCoolerState)
|
|
43
|
+
.onGet(this.getTargetHeaterCoolerState.bind(this))
|
|
44
|
+
.onSet(this.setTargetHeaterCoolerState.bind(this))
|
|
45
|
+
.setProps({
|
|
46
|
+
validValues: this.configDev.AC_options.heatingCapable
|
|
47
|
+
? [
|
|
48
|
+
this.platform.Characteristic.TargetHeaterCoolerState.AUTO,
|
|
49
|
+
this.platform.Characteristic.TargetHeaterCoolerState.HEAT,
|
|
50
|
+
this.platform.Characteristic.TargetHeaterCoolerState.COOL,
|
|
51
|
+
]
|
|
52
|
+
: [this.platform.Characteristic.TargetHeaterCoolerState.AUTO, this.platform.Characteristic.TargetHeaterCoolerState.COOL],
|
|
53
|
+
});
|
|
54
|
+
this.service.getCharacteristic(this.platform.Characteristic.CurrentTemperature).onGet(this.getCurrentTemperature.bind(this));
|
|
55
|
+
this.service
|
|
56
|
+
.getCharacteristic(this.platform.Characteristic.CoolingThresholdTemperature)
|
|
57
|
+
.onGet(this.getTargetTemperature.bind(this))
|
|
58
|
+
.onSet(this.setTargetTemperature.bind(this))
|
|
59
|
+
.setProps({
|
|
60
|
+
minValue: this.configDev.AC_options.minTemp,
|
|
61
|
+
maxValue: this.configDev.AC_options.maxTemp,
|
|
62
|
+
minStep: this.configDev.AC_options.tempStep,
|
|
63
|
+
});
|
|
64
|
+
this.service
|
|
65
|
+
.getCharacteristic(this.platform.Characteristic.HeatingThresholdTemperature)
|
|
66
|
+
.onGet(this.getTargetTemperature.bind(this))
|
|
67
|
+
.onSet(this.setTargetTemperature.bind(this))
|
|
68
|
+
.setProps({
|
|
69
|
+
minValue: this.configDev.AC_options.minTemp,
|
|
70
|
+
maxValue: this.configDev.AC_options.maxTemp,
|
|
71
|
+
minStep: this.configDev.AC_options.tempStep,
|
|
72
|
+
});
|
|
73
|
+
this.service
|
|
74
|
+
.getCharacteristic(this.platform.Characteristic.RotationSpeed)
|
|
75
|
+
.onGet(this.getRotationSpeed.bind(this))
|
|
76
|
+
.onSet(this.setRotationSpeed.bind(this));
|
|
77
|
+
// Swing modes
|
|
78
|
+
if (this.configDev.AC_options.swing.mode !== SwingMode.NONE) {
|
|
79
|
+
this.service
|
|
80
|
+
.getCharacteristic(this.platform.Characteristic.SwingMode)
|
|
81
|
+
.onGet(this.getSwingMode.bind(this))
|
|
82
|
+
.onSet(this.setSwingMode.bind(this));
|
|
83
|
+
}
|
|
84
|
+
// Outdoor temperature sensor
|
|
85
|
+
this.outDoorTemperatureService = this.accessory.getServiceById(this.platform.Service.TemperatureSensor, 'Outdoor');
|
|
86
|
+
if (this.configDev.AC_options.outDoorTemp) {
|
|
87
|
+
this.outDoorTemperatureService ??= this.accessory.addService(this.platform.Service.TemperatureSensor, `${this.device.name} Outdoor`, 'Outdoor');
|
|
88
|
+
this.outDoorTemperatureService.setCharacteristic(this.platform.Characteristic.Name, `${this.device.name} Outdoor`);
|
|
89
|
+
this.outDoorTemperatureService.setCharacteristic(this.platform.Characteristic.ConfiguredName, `${this.device.name} Outdoor`);
|
|
90
|
+
this.outDoorTemperatureService
|
|
91
|
+
.getCharacteristic(this.platform.Characteristic.CurrentTemperature)
|
|
92
|
+
.onGet(this.getOutdoorTemperature.bind(this));
|
|
93
|
+
this.outDoorTemperatureService
|
|
94
|
+
.getCharacteristic(this.platform.Characteristic.StatusFault)
|
|
95
|
+
.onGet(() => this.device.attributes.OUTDOOR_TEMPERATURE === undefined
|
|
96
|
+
? this.platform.Characteristic.StatusFault.GENERAL_FAULT
|
|
97
|
+
: this.platform.Characteristic.StatusFault.NO_FAULT);
|
|
98
|
+
}
|
|
99
|
+
else if (this.outDoorTemperatureService) {
|
|
100
|
+
this.accessory.removeService(this.outDoorTemperatureService);
|
|
101
|
+
}
|
|
102
|
+
// Fan-only mode switch
|
|
103
|
+
this.fanOnlyService = this.accessory.getServiceById(this.platform.Service.Switch, 'FanOnly');
|
|
104
|
+
if (this.configDev.AC_options.fanOnlyModeSwitch) {
|
|
105
|
+
this.fanOnlyService ??= this.accessory.addService(this.platform.Service.Switch, `${this.device.name} FanOnly`, 'FanOnly');
|
|
106
|
+
this.fanOnlyService.setCharacteristic(this.platform.Characteristic.Name, `${this.device.name} Fan-only Mode`);
|
|
107
|
+
this.fanOnlyService.setCharacteristic(this.platform.Characteristic.ConfiguredName, `${this.device.name} Fan-only Mode`);
|
|
108
|
+
this.fanOnlyService
|
|
109
|
+
.getCharacteristic(this.platform.Characteristic.On)
|
|
110
|
+
.onGet(this.getFanOnlyMode.bind(this))
|
|
111
|
+
.onSet(this.setFanOnlyMode.bind(this));
|
|
112
|
+
}
|
|
113
|
+
else if (this.fanOnlyService) {
|
|
114
|
+
this.accessory.removeService(this.fanOnlyService);
|
|
115
|
+
}
|
|
116
|
+
// Fan accessory
|
|
117
|
+
this.fanService = this.accessory.getServiceById(this.platform.Service.Fanv2, 'Fan');
|
|
118
|
+
if (this.configDev.AC_options.fanAccessory) {
|
|
119
|
+
this.fanService ??= this.accessory.addService(this.platform.Service.Fanv2, `${this.device.name} Fan`, 'Fan');
|
|
120
|
+
this.fanService.setCharacteristic(this.platform.Characteristic.Name, `${this.device.name} Fan`);
|
|
121
|
+
this.fanService.setCharacteristic(this.platform.Characteristic.ConfiguredName, `${this.device.name} Fan`);
|
|
122
|
+
this.fanService
|
|
123
|
+
.getCharacteristic(this.platform.Characteristic.Active)
|
|
124
|
+
.onGet(this.getActive.bind(this))
|
|
125
|
+
.onSet(this.setActive.bind(this));
|
|
126
|
+
this.fanService
|
|
127
|
+
.getCharacteristic(this.platform.Characteristic.RotationSpeed)
|
|
128
|
+
.onGet(this.getRotationSpeed.bind(this))
|
|
129
|
+
.onSet(this.setRotationSpeed.bind(this));
|
|
130
|
+
this.fanService
|
|
131
|
+
.getCharacteristic(this.platform.Characteristic.TargetFanState)
|
|
132
|
+
.onGet(this.getFanState.bind(this))
|
|
133
|
+
.onSet(this.setFanState.bind(this));
|
|
134
|
+
this.fanService
|
|
135
|
+
.getCharacteristic(this.platform.Characteristic.SwingMode)
|
|
136
|
+
.onGet(this.getSwingMode.bind(this))
|
|
137
|
+
.onSet(this.setSwingMode.bind(this));
|
|
138
|
+
}
|
|
139
|
+
else if (this.fanService) {
|
|
140
|
+
this.accessory.removeService(this.fanService);
|
|
141
|
+
}
|
|
142
|
+
// Display switch
|
|
143
|
+
this.displayService = this.accessory.getServiceById(this.platform.Service.Switch, 'Display');
|
|
144
|
+
if (this.configDev.AC_options.displaySwitch.flag) {
|
|
145
|
+
this.device.set_alternate_switch_display(this.configDev.AC_options.displaySwitch.command);
|
|
146
|
+
this.displayService ??= this.accessory.addService(this.platform.Service.Switch, `${this.device.name} Display`, 'Display');
|
|
147
|
+
this.displayService.setCharacteristic(this.platform.Characteristic.Name, `${this.device.name} Display`);
|
|
148
|
+
this.displayService.setCharacteristic(this.platform.Characteristic.ConfiguredName, `${this.device.name} Display`);
|
|
149
|
+
this.displayService
|
|
150
|
+
.getCharacteristic(this.platform.Characteristic.On)
|
|
151
|
+
.onGet(this.getDisplayActive.bind(this))
|
|
152
|
+
.onSet(this.setDisplayActive.bind(this));
|
|
153
|
+
}
|
|
154
|
+
else if (this.displayService) {
|
|
155
|
+
this.accessory.removeService(this.displayService);
|
|
156
|
+
}
|
|
157
|
+
// Eco mode switch
|
|
158
|
+
this.ecoModeService = this.accessory.getServiceById(this.platform.Service.Switch, 'EcoMode');
|
|
159
|
+
if (this.configDev.AC_options.ecoSwitch) {
|
|
160
|
+
this.ecoModeService ??= this.accessory.addService(this.platform.Service.Switch, `${this.device.name} Eco`, 'EcoMode');
|
|
161
|
+
this.ecoModeService.setCharacteristic(this.platform.Characteristic.Name, `${this.device.name} Eco`);
|
|
162
|
+
this.ecoModeService.setCharacteristic(this.platform.Characteristic.ConfiguredName, `${this.device.name} Eco`);
|
|
163
|
+
this.ecoModeService
|
|
164
|
+
.getCharacteristic(this.platform.Characteristic.On)
|
|
165
|
+
.onGet(this.getEcoMode.bind(this))
|
|
166
|
+
.onSet(this.setEcoMode.bind(this));
|
|
167
|
+
}
|
|
168
|
+
else if (this.ecoModeService) {
|
|
169
|
+
this.accessory.removeService(this.ecoModeService);
|
|
170
|
+
}
|
|
171
|
+
// Breeze away switch
|
|
172
|
+
this.breezeAwayService = this.accessory.getServiceById(this.platform.Service.Switch, 'BreezeAway');
|
|
173
|
+
if (this.configDev.AC_options.breezeAwaySwitch) {
|
|
174
|
+
this.breezeAwayService ??= this.accessory.addService(this.platform.Service.Switch, `${this.device.name} Breeze`, 'BreezeAway');
|
|
175
|
+
this.breezeAwayService.setCharacteristic(this.platform.Characteristic.Name, `${this.device.name} Breeze`);
|
|
176
|
+
this.breezeAwayService.setCharacteristic(this.platform.Characteristic.ConfiguredName, `${this.device.name} Breeze`);
|
|
177
|
+
this.breezeAwayService
|
|
178
|
+
.getCharacteristic(this.platform.Characteristic.On)
|
|
179
|
+
.onGet(this.getBreezeAway.bind(this))
|
|
180
|
+
.onSet(this.setBreezeAway.bind(this));
|
|
181
|
+
}
|
|
182
|
+
else if (this.breezeAwayService) {
|
|
183
|
+
this.accessory.removeService(this.breezeAwayService);
|
|
184
|
+
}
|
|
185
|
+
// Dry mode switch
|
|
186
|
+
this.dryModeService = this.accessory.getServiceById(this.platform.Service.Switch, 'DryMode');
|
|
187
|
+
if (this.configDev.AC_options.dryModeSwitch) {
|
|
188
|
+
this.dryModeService ??= this.accessory.addService(this.platform.Service.Switch, `${this.device.name} Dry`, 'DryMode');
|
|
189
|
+
this.dryModeService.setCharacteristic(this.platform.Characteristic.Name, `${this.device.name} Dry`);
|
|
190
|
+
this.dryModeService.setCharacteristic(this.platform.Characteristic.ConfiguredName, `${this.device.name} Dry`);
|
|
191
|
+
this.dryModeService
|
|
192
|
+
.getCharacteristic(this.platform.Characteristic.On)
|
|
193
|
+
.onGet(this.getDryMode.bind(this))
|
|
194
|
+
.onSet(this.setDryMode.bind(this));
|
|
195
|
+
}
|
|
196
|
+
else if (this.dryModeService) {
|
|
197
|
+
this.accessory.removeService(this.dryModeService);
|
|
198
|
+
}
|
|
199
|
+
this.boostModeService = this.accessory.getServiceById(this.platform.Service.Switch, 'BoostMode');
|
|
200
|
+
if (this.configDev.AC_options.boostModeSwitch) {
|
|
201
|
+
this.boostModeService ??= this.accessory.addService(this.platform.Service.Switch, `${this.device.name} Boost`, 'BoostMode');
|
|
202
|
+
this.boostModeService.setCharacteristic(this.platform.Characteristic.Name, `${this.device.name} Boost`);
|
|
203
|
+
this.boostModeService.setCharacteristic(this.platform.Characteristic.ConfiguredName, `${this.device.name} Boost`);
|
|
204
|
+
this.boostModeService
|
|
205
|
+
.getCharacteristic(this.platform.Characteristic.On)
|
|
206
|
+
.onGet(this.getBoostMode.bind(this))
|
|
207
|
+
.onSet(this.setBoostMode.bind(this));
|
|
208
|
+
}
|
|
209
|
+
else if (this.boostModeService) {
|
|
210
|
+
this.accessory.removeService(this.boostModeService);
|
|
211
|
+
}
|
|
212
|
+
// Aux switch
|
|
213
|
+
this.auxService = this.accessory.getServiceById(this.platform.Service.Switch, 'Aux');
|
|
214
|
+
if (this.configDev.AC_options.auxHeatingSwitches) {
|
|
215
|
+
this.auxService ??= this.accessory.addService(this.platform.Service.Switch, `${this.device.name} Aux`, 'Aux');
|
|
216
|
+
this.auxService.setCharacteristic(this.platform.Characteristic.Name, `${this.device.name} Aux`);
|
|
217
|
+
this.auxService.setCharacteristic(this.platform.Characteristic.ConfiguredName, `${this.device.name} Aux`);
|
|
218
|
+
this.auxService.getCharacteristic(this.platform.Characteristic.On).onGet(this.getAux.bind(this)).onSet(this.setAux.bind(this));
|
|
219
|
+
}
|
|
220
|
+
else if (this.auxService) {
|
|
221
|
+
this.accessory.removeService(this.auxService);
|
|
222
|
+
}
|
|
223
|
+
// Aux+Heat switch
|
|
224
|
+
this.auxHeatingService = this.accessory.getServiceById(this.platform.Service.Switch, 'AuxHeating');
|
|
225
|
+
if (this.configDev.AC_options.auxHeatingSwitches) {
|
|
226
|
+
this.auxHeatingService ??= this.accessory.addService(this.platform.Service.Switch, `${this.device.name} Aux+Heat`, 'AuxHeating');
|
|
227
|
+
this.auxHeatingService.setCharacteristic(this.platform.Characteristic.Name, `${this.device.name} Aux+Heat`);
|
|
228
|
+
this.auxHeatingService.setCharacteristic(this.platform.Characteristic.ConfiguredName, `${this.device.name} Aux+Heat`);
|
|
229
|
+
this.auxHeatingService
|
|
230
|
+
.getCharacteristic(this.platform.Characteristic.On)
|
|
231
|
+
.onGet(this.getAuxHeating.bind(this))
|
|
232
|
+
.onSet(this.setAuxHeating.bind(this));
|
|
233
|
+
}
|
|
234
|
+
else if (this.auxHeatingService) {
|
|
235
|
+
this.accessory.removeService(this.auxHeatingService);
|
|
236
|
+
}
|
|
237
|
+
// Self-cleaning switch
|
|
238
|
+
this.selfCleanService = this.accessory.getServiceById(this.platform.Service.Switch, 'SelfClean');
|
|
239
|
+
if (this.configDev.AC_options.selfCleanSwitch) {
|
|
240
|
+
this.selfCleanService ??= this.accessory.addService(this.platform.Service.Switch, `${this.device.name} Self-cleaning`, 'SelfClean');
|
|
241
|
+
this.selfCleanService.setCharacteristic(this.platform.Characteristic.Name, `${this.device.name} Self-cleaning`);
|
|
242
|
+
this.selfCleanService.setCharacteristic(this.platform.Characteristic.ConfiguredName, `${this.device.name} Self-cleaning`);
|
|
243
|
+
this.selfCleanService
|
|
244
|
+
.getCharacteristic(this.platform.Characteristic.On)
|
|
245
|
+
.onGet(this.getSelfCleanState.bind(this))
|
|
246
|
+
.onSet(this.setSelfCleanState.bind(this));
|
|
247
|
+
}
|
|
248
|
+
else if (this.selfCleanService) {
|
|
249
|
+
this.accessory.removeService(this.selfCleanService);
|
|
250
|
+
}
|
|
251
|
+
// ION switch
|
|
252
|
+
this.ionService = this.accessory.getServiceById(this.platform.Service.Switch, 'ION');
|
|
253
|
+
if (this.configDev.AC_options.ionSwitch) {
|
|
254
|
+
this.ionService ??= this.accessory.addService(this.platform.Service.Switch, `${this.device.name} ION`, 'ION');
|
|
255
|
+
this.ionService.setCharacteristic(this.platform.Characteristic.Name, `${this.device.name} ION`);
|
|
256
|
+
this.ionService.setCharacteristic(this.platform.Characteristic.ConfiguredName, `${this.device.name} ION`);
|
|
257
|
+
this.ionService
|
|
258
|
+
.getCharacteristic(this.platform.Characteristic.On)
|
|
259
|
+
.onGet(this.getIonState.bind(this))
|
|
260
|
+
.onSet(this.setIonState.bind(this));
|
|
261
|
+
}
|
|
262
|
+
else if (this.ionService) {
|
|
263
|
+
this.accessory.removeService(this.ionService);
|
|
264
|
+
}
|
|
265
|
+
// Rate select slider
|
|
266
|
+
this.rateSelectService = this.accessory.getServiceById(this.platform.Service.Lightbulb, 'Gear');
|
|
267
|
+
if (this.configDev.AC_options.rateSelector) {
|
|
268
|
+
this.rateSelectService ??= this.accessory.addService(this.platform.Service.Lightbulb, `${this.device.name} Gear`, 'Gear');
|
|
269
|
+
this.rateSelectService.setCharacteristic(this.platform.Characteristic.Name, `${this.device.name} Gear`);
|
|
270
|
+
this.rateSelectService.setCharacteristic(this.platform.Characteristic.ConfiguredName, `${this.device.name} Gear`);
|
|
271
|
+
this.rateSelectService
|
|
272
|
+
.getCharacteristic(this.platform.Characteristic.On)
|
|
273
|
+
.onGet(this.getActive.bind(this))
|
|
274
|
+
.onSet(this.setActive.bind(this));
|
|
275
|
+
this.rateSelectService
|
|
276
|
+
.getCharacteristic(this.platform.Characteristic.Brightness)
|
|
277
|
+
.setProps({
|
|
278
|
+
validValues: [0, 50, 75, 100],
|
|
279
|
+
})
|
|
280
|
+
.onGet(this.getRateSelect.bind(this))
|
|
281
|
+
.onSet(this.setRateSelect.bind(this));
|
|
282
|
+
}
|
|
283
|
+
else if (this.rateSelectService) {
|
|
284
|
+
this.accessory.removeService(this.rateSelectService);
|
|
285
|
+
}
|
|
286
|
+
const swingProps = this.configDev.AC_options.swing;
|
|
287
|
+
this.swingAngleMainControl =
|
|
288
|
+
swingProps.mode === SwingMode.VERTICAL || (swingProps.mode === SwingMode.BOTH && swingProps.angleMainControl === SwingAngle.VERTICAL)
|
|
289
|
+
? SwingAngle.VERTICAL
|
|
290
|
+
: SwingAngle.HORIZONTAL;
|
|
291
|
+
// Swing angle accessory
|
|
292
|
+
this.swingAngleService = this.accessory.getServiceById(this.platform.Service.WindowCovering, 'SwingAngle');
|
|
293
|
+
if (swingProps.mode !== SwingMode.NONE && swingProps.angleAccessory) {
|
|
294
|
+
this.swingAngleService ??= this.accessory.addService(this.platform.Service.WindowCovering, `${this.device.name} Swing`, 'SwingAngle');
|
|
295
|
+
this.swingAngleService.setCharacteristic(this.platform.Characteristic.Name, `${this.device.name} Swing`);
|
|
296
|
+
this.swingAngleService.setCharacteristic(this.platform.Characteristic.ConfiguredName, `${this.device.name} Swing`);
|
|
297
|
+
this.swingAngleService
|
|
298
|
+
.getCharacteristic(this.platform.Characteristic.CurrentPosition)
|
|
299
|
+
.onGet(this.getSwingAngleCurrentPosition.bind(this));
|
|
300
|
+
this.swingAngleService
|
|
301
|
+
.getCharacteristic(this.platform.Characteristic.TargetPosition)
|
|
302
|
+
.onGet(this.getSwingAngleTargetPosition.bind(this))
|
|
303
|
+
.onSet(this.setSwingAngleTargetPosition.bind(this));
|
|
304
|
+
this.swingAngleService
|
|
305
|
+
.getCharacteristic(this.platform.Characteristic.PositionState)
|
|
306
|
+
.onGet(this.getSwingAnglePositionState.bind(this));
|
|
307
|
+
if (swingProps.mode === SwingMode.BOTH) {
|
|
308
|
+
this.swingAngleService
|
|
309
|
+
.getCharacteristic(this.platform.Characteristic.CurrentHorizontalTiltAngle)
|
|
310
|
+
.onGet(this.getSwingAngleCurrentHorizontalTiltAngle.bind(this));
|
|
311
|
+
this.swingAngleService
|
|
312
|
+
.getCharacteristic(this.platform.Characteristic.TargetHorizontalTiltAngle)
|
|
313
|
+
.onGet(this.getSwingAngleTargetHorizontalTiltAngle.bind(this))
|
|
314
|
+
.onSet(this.setSwingAngleTargetHorizontalTiltAngle.bind(this));
|
|
315
|
+
this.swingAngleService
|
|
316
|
+
.getCharacteristic(this.platform.Characteristic.CurrentVerticalTiltAngle)
|
|
317
|
+
.onGet(this.getSwingAngleCurrentVerticalTiltAngle.bind(this));
|
|
318
|
+
this.swingAngleService
|
|
319
|
+
.getCharacteristic(this.platform.Characteristic.TargetVerticalTiltAngle)
|
|
320
|
+
.onGet(this.getSwingAngleTargetVerticalTiltAngle.bind(this))
|
|
321
|
+
.onSet(this.setSwingAngleTargetVerticalTiltAngle.bind(this));
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
// Misc
|
|
325
|
+
this.device.attributes.PROMPT_TONE = this.configDev.AC_options.audioFeedback;
|
|
326
|
+
this.device.attributes.TEMP_FAHRENHEIT = this.configDev.AC_options.fahrenheit;
|
|
327
|
+
}
|
|
328
|
+
/*********************************************************************
|
|
329
|
+
* Callback function called by MideaDevice whenever there is a change to
|
|
330
|
+
* any attribute value.
|
|
331
|
+
*/
|
|
332
|
+
async updateCharacteristics(attributes) {
|
|
333
|
+
for (const [k, v] of Object.entries(attributes)) {
|
|
334
|
+
this.platform.log.debug(`[${this.device.name}] Set attribute ${k} to: ${v}`);
|
|
335
|
+
let updateState = false;
|
|
336
|
+
switch (k.toLowerCase()) {
|
|
337
|
+
case 'power':
|
|
338
|
+
updateState = true;
|
|
339
|
+
break;
|
|
340
|
+
case 'temp_fahrenheit':
|
|
341
|
+
this.service.updateCharacteristic(this.platform.Characteristic.TemperatureDisplayUnits, this.getTemperatureDisplayUnits());
|
|
342
|
+
break;
|
|
343
|
+
case 'screen_display':
|
|
344
|
+
case 'screen_display_new':
|
|
345
|
+
this.displayService?.updateCharacteristic(this.platform.Characteristic.On, this.getDisplayActive());
|
|
346
|
+
break;
|
|
347
|
+
case 'target_temperature':
|
|
348
|
+
// If MODE is 4 then device is heating. Therefore target temperature value must be heating target? Right?
|
|
349
|
+
if (this.device.attributes.MODE === 4) {
|
|
350
|
+
this.service.updateCharacteristic(this.platform.Characteristic.HeatingThresholdTemperature, this.getTargetTemperature());
|
|
351
|
+
}
|
|
352
|
+
else {
|
|
353
|
+
this.service.updateCharacteristic(this.platform.Characteristic.CoolingThresholdTemperature, this.getTargetTemperature());
|
|
354
|
+
}
|
|
355
|
+
updateState = true;
|
|
356
|
+
break;
|
|
357
|
+
case 'indoor_temperature':
|
|
358
|
+
this.service.updateCharacteristic(this.platform.Characteristic.CurrentTemperature, this.getCurrentTemperature());
|
|
359
|
+
break;
|
|
360
|
+
case 'outdoor_temperature':
|
|
361
|
+
this.outDoorTemperatureService?.updateCharacteristic(this.platform.Characteristic.CurrentTemperature, this.getOutdoorTemperature());
|
|
362
|
+
break;
|
|
363
|
+
case 'fan_speed':
|
|
364
|
+
updateState = true;
|
|
365
|
+
break;
|
|
366
|
+
case 'fan_auto':
|
|
367
|
+
this.fanService?.updateCharacteristic(this.platform.Characteristic.TargetFanState, this.getFanState());
|
|
368
|
+
break;
|
|
369
|
+
case 'swing_vertical':
|
|
370
|
+
case 'swing_horizontal':
|
|
371
|
+
this.service.updateCharacteristic(this.platform.Characteristic.SwingMode, this.getSwingMode());
|
|
372
|
+
break;
|
|
373
|
+
case 'mode':
|
|
374
|
+
updateState = true;
|
|
375
|
+
break;
|
|
376
|
+
case 'eco_mode':
|
|
377
|
+
this.ecoModeService?.updateCharacteristic(this.platform.Characteristic.On, this.getEcoMode());
|
|
378
|
+
break;
|
|
379
|
+
case 'indirect_wind':
|
|
380
|
+
this.breezeAwayService?.updateCharacteristic(this.platform.Characteristic.On, this.getBreezeAway());
|
|
381
|
+
break;
|
|
382
|
+
case 'aux_heating':
|
|
383
|
+
this.auxHeatingService?.updateCharacteristic(this.platform.Characteristic.On, this.getAuxHeating());
|
|
384
|
+
break;
|
|
385
|
+
case 'smart_eye':
|
|
386
|
+
this.auxService?.updateCharacteristic(this.platform.Characteristic.On, this.getAux());
|
|
387
|
+
break;
|
|
388
|
+
case 'wind_swing_lr_angle':
|
|
389
|
+
case 'wind_swing_ud_angle':
|
|
390
|
+
this.swingAngleService?.updateCharacteristic(this.platform.Characteristic.CurrentPosition, this.getSwingAngleCurrentPosition());
|
|
391
|
+
this.swingAngleService?.updateCharacteristic(this.platform.Characteristic.TargetPosition, this.getSwingAngleTargetPosition());
|
|
392
|
+
if (this.configDev.AC_options.swing.mode === SwingMode.BOTH) {
|
|
393
|
+
this.swingAngleService?.updateCharacteristic(this.platform.Characteristic.CurrentHorizontalTiltAngle, this.getSwingAngleCurrentHorizontalTiltAngle());
|
|
394
|
+
this.swingAngleService?.updateCharacteristic(this.platform.Characteristic.CurrentVerticalTiltAngle, this.getSwingAngleCurrentVerticalTiltAngle());
|
|
395
|
+
this.swingAngleService?.updateCharacteristic(this.platform.Characteristic.TargetHorizontalTiltAngle, this.getSwingAngleTargetHorizontalTiltAngle());
|
|
396
|
+
this.swingAngleService?.updateCharacteristic(this.platform.Characteristic.TargetVerticalTiltAngle, this.getSwingAngleTargetVerticalTiltAngle());
|
|
397
|
+
}
|
|
398
|
+
break;
|
|
399
|
+
case 'self_clean':
|
|
400
|
+
updateState = true;
|
|
401
|
+
this.selfCleanService?.updateCharacteristic(this.platform.Characteristic.On, this.getSelfCleanState());
|
|
402
|
+
break;
|
|
403
|
+
case 'ion':
|
|
404
|
+
this.ionService?.updateCharacteristic(this.platform.Characteristic.On, this.getIonState());
|
|
405
|
+
break;
|
|
406
|
+
case 'rate_select':
|
|
407
|
+
this.rateSelectService?.updateCharacteristic(this.platform.Characteristic.Brightness, this.getRateSelect());
|
|
408
|
+
break;
|
|
409
|
+
default:
|
|
410
|
+
this.platform.log.debug(`[${this.device.name}] Attempt to set unsupported attribute ${k} to ${v}`);
|
|
411
|
+
}
|
|
412
|
+
if (updateState) {
|
|
413
|
+
this.service.updateCharacteristic(this.platform.Characteristic.Active, this.getActive());
|
|
414
|
+
this.service.updateCharacteristic(this.platform.Characteristic.TargetHeaterCoolerState, this.getTargetHeaterCoolerState());
|
|
415
|
+
this.service.updateCharacteristic(this.platform.Characteristic.CurrentHeaterCoolerState, this.getCurrentHeaterCoolerState());
|
|
416
|
+
this.service.updateCharacteristic(this.platform.Characteristic.RotationSpeed, this.getRotationSpeed());
|
|
417
|
+
this.fanOnlyService?.updateCharacteristic(this.platform.Characteristic.On, this.getFanOnlyMode());
|
|
418
|
+
this.fanService?.updateCharacteristic(this.platform.Characteristic.Active, this.getActive());
|
|
419
|
+
this.fanService?.updateCharacteristic(this.platform.Characteristic.RotationSpeed, this.getRotationSpeed());
|
|
420
|
+
this.dryModeService?.updateCharacteristic(this.platform.Characteristic.On, this.getDryMode());
|
|
421
|
+
this.displayService?.updateCharacteristic(this.platform.Characteristic.On, this.getDisplayActive());
|
|
422
|
+
this.ecoModeService?.updateCharacteristic(this.platform.Characteristic.On, this.getEcoMode());
|
|
423
|
+
this.breezeAwayService?.updateCharacteristic(this.platform.Characteristic.On, this.getBreezeAway());
|
|
424
|
+
this.auxService?.updateCharacteristic(this.platform.Characteristic.On, this.getAux());
|
|
425
|
+
this.auxHeatingService?.updateCharacteristic(this.platform.Characteristic.On, this.getAuxHeating());
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
/*********************************************************************
|
|
430
|
+
* Callback functions for each Homebridge/HomeKit service
|
|
431
|
+
*
|
|
432
|
+
*/
|
|
433
|
+
getActive() {
|
|
434
|
+
// Show as inactive if device is off
|
|
435
|
+
return this.device.attributes.POWER ? this.platform.Characteristic.Active.ACTIVE : this.platform.Characteristic.Active.INACTIVE;
|
|
436
|
+
}
|
|
437
|
+
async setActive(value) {
|
|
438
|
+
await this.device.set_attribute({ POWER: !!value });
|
|
439
|
+
this.device.attributes.SCREEN_DISPLAY = !!value;
|
|
440
|
+
this.displayService?.updateCharacteristic(this.platform.Characteristic.On, !!value);
|
|
441
|
+
}
|
|
442
|
+
getTemperatureDisplayUnits() {
|
|
443
|
+
return this.device.attributes.TEMP_FAHRENHEIT
|
|
444
|
+
? this.platform.Characteristic.TemperatureDisplayUnits.FAHRENHEIT
|
|
445
|
+
: this.platform.Characteristic.TemperatureDisplayUnits.CELSIUS;
|
|
446
|
+
}
|
|
447
|
+
async setTemperatureDisplayUnits(value) {
|
|
448
|
+
await this.device.set_attribute({ TEMP_FAHRENHEIT: value === this.platform.Characteristic.TemperatureDisplayUnits.FAHRENHEIT });
|
|
449
|
+
}
|
|
450
|
+
getCurrentHeaterCoolerState() {
|
|
451
|
+
if (this.device.attributes.POWER && this.device.attributes.MODE > 0 && this.device.attributes.MODE < 5) {
|
|
452
|
+
if (this.device.attributes.TARGET_TEMPERATURE < (this.device.attributes.INDOOR_TEMPERATURE ?? 0)) {
|
|
453
|
+
if ([1, 2].includes(this.device.attributes.MODE)) {
|
|
454
|
+
return this.platform.Characteristic.CurrentHeaterCoolerState.COOLING;
|
|
455
|
+
}
|
|
456
|
+
else {
|
|
457
|
+
return this.platform.Characteristic.CurrentHeaterCoolerState.IDLE;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
else if (this.device.attributes.TARGET_TEMPERATURE === this.device.attributes.INDOOR_TEMPERATURE) {
|
|
461
|
+
return this.platform.Characteristic.CurrentHeaterCoolerState.IDLE;
|
|
462
|
+
}
|
|
463
|
+
else {
|
|
464
|
+
if (this.device.attributes.MODE === 4) {
|
|
465
|
+
return this.platform.Characteristic.CurrentHeaterCoolerState.HEATING;
|
|
466
|
+
}
|
|
467
|
+
else {
|
|
468
|
+
return this.platform.Characteristic.CurrentHeaterCoolerState.IDLE;
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
else {
|
|
473
|
+
return this.platform.Characteristic.CurrentHeaterCoolerState.INACTIVE;
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
getTargetHeaterCoolerState() {
|
|
477
|
+
if (this.device.attributes.MODE === 2) {
|
|
478
|
+
return this.platform.Characteristic.TargetHeaterCoolerState.COOL;
|
|
479
|
+
}
|
|
480
|
+
else if (this.device.attributes.MODE === 4) {
|
|
481
|
+
return this.platform.Characteristic.TargetHeaterCoolerState.HEAT;
|
|
482
|
+
}
|
|
483
|
+
else {
|
|
484
|
+
return this.platform.Characteristic.TargetHeaterCoolerState.AUTO;
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
async setTargetHeaterCoolerState(value) {
|
|
488
|
+
switch (value) {
|
|
489
|
+
case this.platform.Characteristic.TargetHeaterCoolerState.AUTO:
|
|
490
|
+
await this.device.set_attribute({ POWER: true, MODE: 1 });
|
|
491
|
+
break;
|
|
492
|
+
case this.platform.Characteristic.TargetHeaterCoolerState.COOL:
|
|
493
|
+
await this.device.set_attribute({ POWER: true, MODE: 2 });
|
|
494
|
+
break;
|
|
495
|
+
case this.platform.Characteristic.TargetHeaterCoolerState.HEAT:
|
|
496
|
+
await this.device.set_attribute({ POWER: true, MODE: 4 });
|
|
497
|
+
break;
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
getCurrentTemperature() {
|
|
501
|
+
return this.device.attributes.INDOOR_TEMPERATURE ?? this.configDev.AC_options.minTemp;
|
|
502
|
+
}
|
|
503
|
+
getTargetTemperature() {
|
|
504
|
+
return Math.max(this.configDev.AC_options.minTemp, Math.min(this.configDev.AC_options.maxTemp, this.device.attributes.TARGET_TEMPERATURE));
|
|
505
|
+
}
|
|
506
|
+
getFanOnlyMode() {
|
|
507
|
+
return this.device.attributes.POWER === true && this.device.attributes.MODE === 5;
|
|
508
|
+
}
|
|
509
|
+
async setFanOnlyMode(value) {
|
|
510
|
+
if (value) {
|
|
511
|
+
await this.device.set_attribute({ POWER: true, MODE: 5 });
|
|
512
|
+
}
|
|
513
|
+
else {
|
|
514
|
+
await this.device.set_attribute({ POWER: false, MODE: 0 });
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
getFanState() {
|
|
518
|
+
return this.device.attributes.FAN_AUTO;
|
|
519
|
+
}
|
|
520
|
+
async setFanState(value) {
|
|
521
|
+
await this.device.set_fan_auto(value === this.platform.Characteristic.TargetFanState.AUTO);
|
|
522
|
+
}
|
|
523
|
+
async setTargetTemperature(value) {
|
|
524
|
+
value = Math.max(this.configDev.AC_options.minTemp, Math.min(this.configDev.AC_options.maxTemp, value));
|
|
525
|
+
await this.device.set_target_temperature(value);
|
|
526
|
+
}
|
|
527
|
+
getSwingMode() {
|
|
528
|
+
return this.device.attributes.SWING_HORIZONTAL || this.device.attributes.SWING_VERTICAL
|
|
529
|
+
? this.platform.Characteristic.SwingMode.SWING_ENABLED
|
|
530
|
+
: this.platform.Characteristic.SwingMode.SWING_DISABLED;
|
|
531
|
+
}
|
|
532
|
+
async setSwingMode(value) {
|
|
533
|
+
switch (value) {
|
|
534
|
+
case this.platform.Characteristic.SwingMode.SWING_ENABLED:
|
|
535
|
+
await this.device.set_swing([SwingMode.HORIZONTAL, SwingMode.BOTH].includes(this.configDev.AC_options.swing.mode), [SwingMode.VERTICAL, SwingMode.BOTH].includes(this.configDev.AC_options.swing.mode));
|
|
536
|
+
break;
|
|
537
|
+
case this.platform.Characteristic.SwingMode.SWING_DISABLED:
|
|
538
|
+
await this.device.set_swing(false, false);
|
|
539
|
+
break;
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
getRotationSpeed() {
|
|
543
|
+
return Math.min(100, this.device.attributes.FAN_SPEED ?? 0);
|
|
544
|
+
}
|
|
545
|
+
async setRotationSpeed(value) {
|
|
546
|
+
await this.device.set_attribute({ FAN_SPEED: value });
|
|
547
|
+
}
|
|
548
|
+
getOutdoorTemperature() {
|
|
549
|
+
return this.device.attributes.OUTDOOR_TEMPERATURE ?? -270;
|
|
550
|
+
}
|
|
551
|
+
getDisplayActive() {
|
|
552
|
+
return this.device.attributes.SCREEN_DISPLAY === true;
|
|
553
|
+
}
|
|
554
|
+
async setDisplayActive(value) {
|
|
555
|
+
if (this.device.attributes.POWER) {
|
|
556
|
+
await this.device.set_attribute({ SCREEN_DISPLAY: !!value });
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
getEcoMode() {
|
|
560
|
+
return this.device.attributes.POWER === true && this.device.attributes.ECO_MODE;
|
|
561
|
+
}
|
|
562
|
+
async setEcoMode(value) {
|
|
563
|
+
await this.device.set_attribute({ ECO_MODE: !!value });
|
|
564
|
+
}
|
|
565
|
+
getBreezeAway() {
|
|
566
|
+
return this.device.attributes.POWER === true && this.device.attributes.INDIRECT_WIND;
|
|
567
|
+
}
|
|
568
|
+
async setBreezeAway(value) {
|
|
569
|
+
await this.device.set_attribute({ INDIRECT_WIND: !!value });
|
|
570
|
+
}
|
|
571
|
+
getDryMode() {
|
|
572
|
+
return this.device.attributes.POWER === true && this.device.attributes.MODE === 3;
|
|
573
|
+
}
|
|
574
|
+
async setDryMode(value) {
|
|
575
|
+
if (value) {
|
|
576
|
+
await this.device.set_attribute({ POWER: true, MODE: 3 });
|
|
577
|
+
}
|
|
578
|
+
else {
|
|
579
|
+
await this.device.set_attribute({ POWER: false, MODE: 0 });
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
getBoostMode() {
|
|
583
|
+
return this.device.attributes.POWER === true && this.device.attributes.BOOST_MODE;
|
|
584
|
+
}
|
|
585
|
+
async setBoostMode(value) {
|
|
586
|
+
if (value) {
|
|
587
|
+
await this.device.set_attribute({ POWER: true, BOOST_MODE: true });
|
|
588
|
+
}
|
|
589
|
+
else {
|
|
590
|
+
await this.device.set_attribute({ BOOST_MODE: false });
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
getAux() {
|
|
594
|
+
return this.device.attributes.POWER === true && this.device.attributes.SMART_EYE === true;
|
|
595
|
+
}
|
|
596
|
+
async setAux(value) {
|
|
597
|
+
if (value) {
|
|
598
|
+
await this.device.set_attribute({ SMART_EYE: true });
|
|
599
|
+
}
|
|
600
|
+
else {
|
|
601
|
+
await this.device.set_attribute({ SMART_EYE: false });
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
getAuxHeating() {
|
|
605
|
+
return this.device.attributes.POWER === true && this.device.attributes.AUX_HEATING === true;
|
|
606
|
+
}
|
|
607
|
+
async setAuxHeating(value) {
|
|
608
|
+
if (value) {
|
|
609
|
+
await this.device.set_attribute({ AUX_HEATING: true });
|
|
610
|
+
}
|
|
611
|
+
else {
|
|
612
|
+
await this.device.set_attribute({ AUX_HEATING: false });
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
getSelfCleanState() {
|
|
616
|
+
return this.device.attributes.SELF_CLEAN === true;
|
|
617
|
+
}
|
|
618
|
+
async setSelfCleanState(value) {
|
|
619
|
+
await this.device.set_self_clean(value === true);
|
|
620
|
+
}
|
|
621
|
+
getIonState() {
|
|
622
|
+
return this.device.attributes.POWER === true && this.device.attributes.ION === true;
|
|
623
|
+
}
|
|
624
|
+
async setIonState(value) {
|
|
625
|
+
await this.device.set_ion(value === true);
|
|
626
|
+
}
|
|
627
|
+
getRateSelect() {
|
|
628
|
+
return this.device.attributes.RATE_SELECT ?? 100;
|
|
629
|
+
}
|
|
630
|
+
async setRateSelect(value) {
|
|
631
|
+
await this.device.set_rate_select(value);
|
|
632
|
+
}
|
|
633
|
+
getSwingAngleCurrentPosition() {
|
|
634
|
+
const value = this.swingAngleMainControl === SwingAngle.VERTICAL
|
|
635
|
+
? this.device.attributes.WIND_SWING_UD_ANGLE
|
|
636
|
+
: this.device.attributes.WIND_SWING_LR_ANGLE;
|
|
637
|
+
return value === 1 ? 0 : value;
|
|
638
|
+
}
|
|
639
|
+
getSwingAngleTargetPosition() {
|
|
640
|
+
return this.getSwingAngleCurrentPosition();
|
|
641
|
+
}
|
|
642
|
+
async setSwingAngleTargetPosition(value) {
|
|
643
|
+
await this.device.set_swing_angle(this.swingAngleMainControl, Math.max(1, value));
|
|
644
|
+
}
|
|
645
|
+
getSwingAnglePositionState() {
|
|
646
|
+
return this.platform.Characteristic.PositionState.STOPPED;
|
|
647
|
+
}
|
|
648
|
+
getSwingAngleCurrentHorizontalTiltAngle() {
|
|
649
|
+
return this.device.attributes.WIND_SWING_LR_ANGLE === 1 ? 0 : this.device.attributes.WIND_SWING_LR_ANGLE;
|
|
650
|
+
}
|
|
651
|
+
getSwingAngleTargetHorizontalTiltAngle() {
|
|
652
|
+
return this.getSwingAngleCurrentHorizontalTiltAngle();
|
|
653
|
+
}
|
|
654
|
+
async setSwingAngleTargetHorizontalTiltAngle(value) {
|
|
655
|
+
await this.device.set_swing_angle(SwingAngle.HORIZONTAL, Math.max(1, value));
|
|
656
|
+
}
|
|
657
|
+
getSwingAngleCurrentVerticalTiltAngle() {
|
|
658
|
+
return this.device.attributes.WIND_SWING_UD_ANGLE === 1 ? 0 : this.device.attributes.WIND_SWING_UD_ANGLE;
|
|
659
|
+
}
|
|
660
|
+
getSwingAngleTargetVerticalTiltAngle() {
|
|
661
|
+
return this.getSwingAngleCurrentVerticalTiltAngle();
|
|
662
|
+
}
|
|
663
|
+
async setSwingAngleTargetVerticalTiltAngle(value) {
|
|
664
|
+
await this.device.set_swing_angle(SwingAngle.VERTICAL, Math.max(1, value));
|
|
665
|
+
}
|
|
666
|
+
}
|
|
663
667
|
//# sourceMappingURL=AirConditionerAccessory.js.map
|