homebridge-melcloud-control 4.0.0-beta.155 → 4.0.0-beta.157
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/package.json +1 -1
- package/src/constants.js +12 -16
- package/src/deviceata.js +36 -43
- package/src/melcloudata.js +9 -13
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "MELCloud Control",
|
|
3
3
|
"name": "homebridge-melcloud-control",
|
|
4
|
-
"version": "4.0.0-beta.
|
|
4
|
+
"version": "4.0.0-beta.157",
|
|
5
5
|
"description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "grzegorz914",
|
package/src/constants.js
CHANGED
|
@@ -35,14 +35,18 @@ export const DeviceType = [
|
|
|
35
35
|
export const TemperatureDisplayUnits = ["°C", "°F"];
|
|
36
36
|
|
|
37
37
|
export const AirConditioner = {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
SystemMapEnumToString: { 0: "Air Conditioner Off", 1: "ir Conditioner On", 2: "ir Conditioner Offline" },
|
|
39
|
+
AirDirectionMapEnumToString: { 0: "Auto", 1: "Swing" },
|
|
40
|
+
CurrentOperationModeHeatherCoolerMapEnumToString: { 0: "Inactive", 1: "Idle", 2: "Heating", 3: "Cooling" },
|
|
41
|
+
CurrentOperationModeThermostatMapEnumToString: { 0: "Inactive", 1: "Heating", 2: "Cooling" },
|
|
42
|
+
OperationModeMapStringToEnum: { "0": 0, "Heat": 1, "Dry": 2, "Cool": 3, "4": 4, "5": 5, "6": 6, "Fan": 7, "Auto": 8, "Isee Heat": 9, "Isee Dry": 10, "Isee Cool": 11 },
|
|
43
|
+
OperationModeMapEnumToString: { 0: "0", 1: "Heat", 2: "Dry", 3: "Cool", 4: "4", 5: "5", 6: "6", 7: "Fan", 8: "Auto", 9: "Isee Heat", 10: "Isee Dry", 11: "Isee Cool" },
|
|
44
|
+
FanSpeedMapStringToEnum: { "Auto": 0, "One": 1, "Two": 2, "Three": 3, "Four": 4, "Five": 5, "0": 0, "1": 1, "2": 2, "3": 3, "4": 4, "5": 5, },
|
|
45
|
+
FanSpeedMapEnumToString: { 0: "Auto", 1: "One", 2: "Two", 3: "Three", 4: "Four", 5: "Five" },
|
|
46
|
+
VaneVerticalDirectionMapStringToEnum: { "Auto": 0, "One": 1, "Two": 2, "Three": 3, "Four": 4, "Five": 5, "Six": 6, "Swing": 7 },
|
|
47
|
+
VaneVerticalDirectionMapEnumToString: { 0: "Auto", 1: "One", 2: "Two", 3: "Three", 4: "Four", 5: "Five", 6: "Six", 7: "Swing" },
|
|
48
|
+
VaneHorizontalDirectionMapStringToEnum: { "Auto": 0, "Left": 1, "LeftCenter": 2, "Center": 3, "RightCenter": 4, "Right": 5, "Six": 6, "Seven": 7, "Split": 8, "Nine": 9, "Ten": 10, "Eleven": 11, "Swing": 12 },
|
|
49
|
+
VaneHorizontalDirectionMapEnumToString: { 0: "Auto", 1: "Left", 2: "LeftCenter", 3: "Center", 4: "RightCenter", 5: "Right", 6: "Six", 7: "Seven", 8: "Split", 9: "Nine", 10: "Ten", 11: "Eleven", 12: "Swing" },
|
|
46
50
|
EffectiveFlags: {
|
|
47
51
|
Power: 1,
|
|
48
52
|
OperationMode: 2,
|
|
@@ -63,14 +67,6 @@ export const AirConditioner = {
|
|
|
63
67
|
HolidayMode: 131072,
|
|
64
68
|
All: 281483566710825
|
|
65
69
|
},
|
|
66
|
-
OperationModeMapStringToEnum: { "0": 0, "Heat": 1, "Dry": 2, "Cool": 3, "4": 4, "5": 5, "6": 6, "Fan": 7, "Auto": 8, "Isee Heat": 9, "Isee Dry": 10, "Isee Cool": 11 },
|
|
67
|
-
OperationModeMapEnumToString: { 0: "0", 1: "Heat", 2: "Dry", 3: "Cool", 4: "4", 5: "5", 6: "6", 7: "Fan", 8: "Auto", 9: "Isee Heat", 10: "Isee Dry", 11: "Isee Cool" },
|
|
68
|
-
FanSpeedMapStringToEnum: { "Auto": 0, "One": 1, "Two": 2, "Three": 3, "Four": 4, "Five": 5, "0": 0, "1": 1, "2": 2, "3": 3, "4": 4, "5": 5, },
|
|
69
|
-
FanSpeedMapEnumToString: { 0: "Auto", 1: "One", 2: "Two", 3: "Three", 4: "Four", 5: "Five" },
|
|
70
|
-
VaneVerticalDirectionMapStringToEnum: { "Auto": 0, "One": 1, "Two": 2, "Three": 3, "Four": 4, "Five": 5, "Six": 6, "Swing": 7 },
|
|
71
|
-
VaneVerticalDirectionMapEnumToString: { 0: "Auto", 1: "One", 2: "Two", 3: "Three", 4: "Four", 5: "Five", 6: "Six", 7: "Swing" },
|
|
72
|
-
VaneHorizontalDirectionMapStringToEnum: { "Auto": 0, "Left": 1, "LeftCenter": 2, "Center": 3, "RightCenter": 4, "Right": 5, "Six": 6, "Seven": 7, "Split": 8, "Nine": 9, "Ten": 10, "Eleven": 11, "Swing": 12 },
|
|
73
|
-
VaneHorizontalDirectionMapEnumToString: { 0: "Auto", 1: "Left", 2: "LeftCenter", 3: "Center", 4: "RightCenter", 5: "Right", 6: "Six", 7: "Seven", 8: "Split", 9: "Nine", 10: "Ten", 11: "Eleven", 12: "Swing" },
|
|
74
70
|
};
|
|
75
71
|
|
|
76
72
|
export const HeatPump = {
|
package/src/deviceata.js
CHANGED
|
@@ -155,67 +155,67 @@ class DeviceAta extends EventEmitter {
|
|
|
155
155
|
case 'Power':
|
|
156
156
|
deviceData.Device[key] = value;
|
|
157
157
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.Power;
|
|
158
|
-
set = await this.melCloudAta.send(this.accountType,
|
|
158
|
+
set = await this.melCloudAta.send(this.accountType, this.displayMode, deviceData);
|
|
159
159
|
break;
|
|
160
160
|
case 'OperationMode':
|
|
161
161
|
deviceData.Device[key] = value;
|
|
162
162
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.OperationMode
|
|
163
|
-
set = await this.melCloudAta.send(this.accountType,
|
|
163
|
+
set = await this.melCloudAta.send(this.accountType, this.displayMode, deviceData);
|
|
164
164
|
break;
|
|
165
165
|
case 'SetTemperature':
|
|
166
166
|
deviceData.Device[key] = value;
|
|
167
167
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.SetTemperature;
|
|
168
|
-
set = await this.melCloudAta.send(this.accountType,
|
|
168
|
+
set = await this.melCloudAta.send(this.accountType, this.displayMode, deviceData);
|
|
169
169
|
break;
|
|
170
170
|
case 'DefaultCoolingSetTemperature':
|
|
171
171
|
deviceData.Device[key] = value;
|
|
172
172
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.SetTemperature;
|
|
173
|
-
set = await this.melCloudAta.send(this.accountType,
|
|
173
|
+
set = await this.melCloudAta.send(this.accountType, this.displayMode, deviceData);
|
|
174
174
|
break;
|
|
175
175
|
case 'DefaultHeatingSetTemperature':
|
|
176
176
|
deviceData.Device[key] = value;
|
|
177
177
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.SetTemperature;
|
|
178
|
-
set = await this.melCloudAta.send(this.accountType,
|
|
178
|
+
set = await this.melCloudAta.send(this.accountType, this.displayMode, deviceData);
|
|
179
179
|
break;
|
|
180
180
|
case 'FanSpeed':
|
|
181
181
|
deviceData.Device[key] = value;
|
|
182
182
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.SetFanSpeed;
|
|
183
|
-
set = await this.melCloudAta.send(this.accountType,
|
|
183
|
+
set = await this.melCloudAta.send(this.accountType, this.displayMode, deviceData);
|
|
184
184
|
break;
|
|
185
185
|
case 'VaneHorizontalDirection':
|
|
186
186
|
deviceData.Device[key] = value;
|
|
187
187
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.VaneHorizontalDirection;
|
|
188
|
-
set = await this.melCloudAta.send(this.accountType,
|
|
188
|
+
set = await this.melCloudAta.send(this.accountType, this.displayMode, deviceData);
|
|
189
189
|
break;
|
|
190
190
|
case 'VaneVerticalDirection':
|
|
191
191
|
deviceData.Device[key] = value;
|
|
192
192
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.VaneVerticalDirection;
|
|
193
|
-
set = await this.melCloudAta.send(this.accountType,
|
|
193
|
+
set = await this.melCloudAta.send(this.accountType, this.displayMode, deviceData);
|
|
194
194
|
break;
|
|
195
195
|
case 'HideVaneControls':
|
|
196
196
|
deviceData[key] = value;
|
|
197
197
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.Prohibit;
|
|
198
|
-
set = await this.melCloudAta.send(this.accountType,
|
|
198
|
+
set = await this.melCloudAta.send(this.accountType, this.displayMode, deviceData);
|
|
199
199
|
break;
|
|
200
200
|
case 'HideDryModeControl':
|
|
201
201
|
deviceData[key] = value;
|
|
202
202
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.Prohibit;
|
|
203
|
-
await this.melCloudAta.send(this.accountType,
|
|
203
|
+
await this.melCloudAta.send(this.accountType, this.displayMode, deviceData);
|
|
204
204
|
break;
|
|
205
205
|
case 'ProhibitSetTemperature':
|
|
206
206
|
deviceData.Device[key] = value;
|
|
207
207
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.Prohibit;
|
|
208
|
-
set = await this.melCloudAta.send(this.accountType,
|
|
208
|
+
set = await this.melCloudAta.send(this.accountType, this.displayMode, deviceData);
|
|
209
209
|
break;
|
|
210
210
|
case 'ProhibitOperationMode':
|
|
211
211
|
deviceData.Device[key] = value;
|
|
212
212
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.Prohibit;
|
|
213
|
-
await this.melCloudAta.send(this.accountType,
|
|
213
|
+
await this.melCloudAta.send(this.accountType, this.displayMode, deviceData);
|
|
214
214
|
break;
|
|
215
215
|
case 'ProhibitPower':
|
|
216
216
|
deviceData.Device[key] = value;
|
|
217
217
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.Prohibit;
|
|
218
|
-
set = await this.melCloudAta.send(this.accountType,
|
|
218
|
+
set = await this.melCloudAta.send(this.accountType, this.displayMode, deviceData);
|
|
219
219
|
break;
|
|
220
220
|
default:
|
|
221
221
|
this.emit('warn', `${integration}, received key: ${key}, value: ${value}`);
|
|
@@ -294,7 +294,7 @@ class DeviceAta extends EventEmitter {
|
|
|
294
294
|
try {
|
|
295
295
|
deviceData.Device.Power = state
|
|
296
296
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.Power;
|
|
297
|
-
await this.melCloudAta.send(this.accountType,
|
|
297
|
+
await this.melCloudAta.send(this.accountType, this.displayMode, deviceData);
|
|
298
298
|
if (this.logInfo) this.emit('info', `Set power: ${state ? 'ON' : 'OFF'}`);
|
|
299
299
|
} catch (error) {
|
|
300
300
|
if (this.logWarn) this.emit('warn', `Set power error: ${error}`);
|
|
@@ -331,11 +331,9 @@ class DeviceAta extends EventEmitter {
|
|
|
331
331
|
return;
|
|
332
332
|
};
|
|
333
333
|
|
|
334
|
-
this.emit('warn', deviceData.Device.OperationMode);
|
|
335
334
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.OperationMode;
|
|
336
|
-
await this.melCloudAta.send(this.accountType,
|
|
337
|
-
|
|
338
|
-
if (this.logInfo) this.emit('info', `Set operation mode: ${operationModeText}`);
|
|
335
|
+
await this.melCloudAta.send(this.accountType, this.displayMode, deviceData);
|
|
336
|
+
if (this.logInfo) this.emit('info', `Set operation mode: ${AirConditioner.OperationModeMapEnumToString[deviceData.Device.OperationMode]}`);
|
|
339
337
|
} catch (error) {
|
|
340
338
|
if (this.logWarn) this.emit('warn', `Set operation mode error: ${error}`);
|
|
341
339
|
};
|
|
@@ -358,29 +356,24 @@ class DeviceAta extends EventEmitter {
|
|
|
358
356
|
})
|
|
359
357
|
.onSet(async (value) => {
|
|
360
358
|
try {
|
|
361
|
-
let fanSpeedModeText = '';
|
|
362
359
|
const fanKey = this.accountType === 'melcloud' ? 'FanSpeed' : 'SetFanSpeed';
|
|
363
360
|
switch (numberOfFanSpeeds) {
|
|
364
361
|
case 2: //Fan speed mode 2
|
|
365
|
-
fanSpeedModeText = supportsAutomaticFanSpeed ? [7, 1, 2, 0][value] : [7, 1, 2][value];
|
|
366
362
|
deviceData.Device[fanKey] = supportsAutomaticFanSpeed ? [0, 1, 2, 0][value] : [1, 1, 2][value];
|
|
367
363
|
break;
|
|
368
364
|
case 3: //Fan speed mode 3
|
|
369
|
-
fanSpeedModeText = supportsAutomaticFanSpeed ? [7, 1, 2, 3, 0][value] : [7, 1, 2, 3][value];
|
|
370
365
|
deviceData.Device[fanKey] = supportsAutomaticFanSpeed ? [0, 1, 2, 3, 0][value] : [1, 1, 2, 3][value];
|
|
371
366
|
break;
|
|
372
367
|
case 4: //Fan speed mode 4
|
|
373
|
-
fanSpeedModeText = supportsAutomaticFanSpeed ? [7, 1, 2, 3, 4, 0][value] : [7, 1, 2, 3, 4][value];
|
|
374
368
|
deviceData.Device[fanKey] = supportsAutomaticFanSpeed ? [0, 1, 2, 3, 4, 0][value] : [1, 1, 2, 3, 4][value];
|
|
375
369
|
break;
|
|
376
370
|
case 5: //Fan speed mode 5
|
|
377
|
-
fanSpeedModeText = supportsAutomaticFanSpeed ? [7, 1, 2, 3, 4, 5, 0][value] : [7, 1, 2, 3, 4, 5][value];
|
|
378
371
|
deviceData.Device[fanKey] = supportsAutomaticFanSpeed ? [0, 1, 2, 3, 4, 5, 0][value] : [1, 1, 2, 3, 4, 5][value];
|
|
379
372
|
break;
|
|
380
373
|
};
|
|
381
374
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.SetFanSpeed;
|
|
382
|
-
await this.melCloudAta.send(this.accountType,
|
|
383
|
-
if (this.logInfo) this.emit('info', `Set fan speed mode: ${AirConditioner.
|
|
375
|
+
await this.melCloudAta.send(this.accountType, this.displayMode, deviceData);
|
|
376
|
+
if (this.logInfo) this.emit('info', `Set fan speed mode: ${AirConditioner.FanSpeedMapEnumToString[deviceData.Device[fanKey]]}`);
|
|
384
377
|
} catch (error) {
|
|
385
378
|
if (this.logWarn) this.emit('warn', `Set fan speed mode error: ${error}`);
|
|
386
379
|
};
|
|
@@ -398,8 +391,8 @@ class DeviceAta extends EventEmitter {
|
|
|
398
391
|
deviceData.Device.VaneHorizontalDirection = value ? 12 : 0;
|
|
399
392
|
deviceData.Device.VaneVerticalDirection = value ? 7 : 0;
|
|
400
393
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.VaneVerticalVaneHorizontal;
|
|
401
|
-
await this.melCloudAta.send(this.accountType,
|
|
402
|
-
if (this.logInfo) this.emit('info', `Set air direction mode: ${AirConditioner.
|
|
394
|
+
await this.melCloudAta.send(this.accountType, this.displayMode, deviceData);
|
|
395
|
+
if (this.logInfo) this.emit('info', `Set air direction mode: ${AirConditioner.AirDirectionMapEnumToString[value]}`);
|
|
403
396
|
} catch (error) {
|
|
404
397
|
if (this.logWarn) this.emit('warn', `Set vane swing mode error: ${error}`);
|
|
405
398
|
};
|
|
@@ -420,7 +413,7 @@ class DeviceAta extends EventEmitter {
|
|
|
420
413
|
deviceData.Device.SetTemperature = value;
|
|
421
414
|
deviceData.Device.DefaultCoolingSetTemperature = value;
|
|
422
415
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.SetTemperature;
|
|
423
|
-
await this.melCloudAta.send(this.accountType,
|
|
416
|
+
await this.melCloudAta.send(this.accountType, this.displayMode, deviceData);
|
|
424
417
|
if (this.logInfo) this.emit('info', `Set cooling threshold temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
425
418
|
} catch (error) {
|
|
426
419
|
if (this.logWarn) this.emit('warn', `Set cooling threshold temperature error: ${error}`);
|
|
@@ -442,7 +435,7 @@ class DeviceAta extends EventEmitter {
|
|
|
442
435
|
deviceData.Device.SetTemperature = value;
|
|
443
436
|
deviceData.Device.DefaultHeatingSetTemperature = value;
|
|
444
437
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.SetTemperature;
|
|
445
|
-
await this.melCloudAta.send(this.accountType,
|
|
438
|
+
await this.melCloudAta.send(this.accountType, this.displayMode, deviceData);
|
|
446
439
|
if (this.logInfo) this.emit('info', `Set heating threshold temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
447
440
|
} catch (error) {
|
|
448
441
|
if (this.logWarn) this.emit('warn', `Set heating threshold temperature error: ${error}`);
|
|
@@ -461,7 +454,7 @@ class DeviceAta extends EventEmitter {
|
|
|
461
454
|
deviceData.Device.ProhibitOperationMode = value;
|
|
462
455
|
deviceData.Device.ProhibitPower = value;
|
|
463
456
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.Prohibit;
|
|
464
|
-
await this.melCloudAta.send(this.accountType,
|
|
457
|
+
await this.melCloudAta.send(this.accountType, this.displayMode, deviceData);
|
|
465
458
|
if (this.logInfo) this.emit('info', `Set local physical controls: ${value ? 'LOCK' : 'UNLOCK'}`);
|
|
466
459
|
} catch (error) {
|
|
467
460
|
if (this.logWarn) this.emit('warn', `Set lock physical controls error: ${error}`);
|
|
@@ -527,8 +520,8 @@ class DeviceAta extends EventEmitter {
|
|
|
527
520
|
break;
|
|
528
521
|
};
|
|
529
522
|
|
|
530
|
-
await this.melCloudAta.send(this.accountType,
|
|
531
|
-
const operationModeText = AirConditioner.
|
|
523
|
+
await this.melCloudAta.send(this.accountType, this.displayMode, deviceData);
|
|
524
|
+
const operationModeText = AirConditioner.OperationModeMapEnumToString[deviceData.Device.OperationMode];
|
|
532
525
|
if (this.logInfo) this.emit('info', `Set operation mode: ${operationModeText}`);
|
|
533
526
|
} catch (error) {
|
|
534
527
|
if (this.logWarn) this.emit('warn', `Set operation mode error: ${error}`);
|
|
@@ -553,7 +546,7 @@ class DeviceAta extends EventEmitter {
|
|
|
553
546
|
try {
|
|
554
547
|
deviceData.Device.SetTemperature = value;
|
|
555
548
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.SetTemperature;
|
|
556
|
-
await this.melCloudAta.send(this.accountType,
|
|
549
|
+
await this.melCloudAta.send(this.accountType, this.displayMode, deviceData);
|
|
557
550
|
if (this.logInfo) this.emit('info', `Set temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
558
551
|
} catch (error) {
|
|
559
552
|
if (this.logWarn) this.emit('warn', `Set temperature error: ${error}`);
|
|
@@ -664,7 +657,7 @@ class DeviceAta extends EventEmitter {
|
|
|
664
657
|
break;
|
|
665
658
|
};
|
|
666
659
|
|
|
667
|
-
await this.melCloudAta.send(this.accountType,
|
|
660
|
+
await this.melCloudAta.send(this.accountType, this.displayMode, deviceData);
|
|
668
661
|
if (this.logInfo) this.emit('info', `${state ? 'Set:' : 'Unset:'} ${name}`);
|
|
669
662
|
} catch (error) {
|
|
670
663
|
if (this.logWarn) this.emit('warn', `Set preset error: ${error}`);
|
|
@@ -905,7 +898,7 @@ class DeviceAta extends EventEmitter {
|
|
|
905
898
|
break;
|
|
906
899
|
};
|
|
907
900
|
|
|
908
|
-
await this.melCloudAta.send(this.accountType,
|
|
901
|
+
await this.melCloudAta.send(this.accountType, this.displayMode, deviceData);
|
|
909
902
|
if (this.logInfo) this.emit('info', `${state ? `Set: ${name}` : `Unset: ${name}, Set: ${button.previousValue}`}`);
|
|
910
903
|
} catch (error) {
|
|
911
904
|
if (this.logWarn) this.emit('warn', `Set button error: ${error}`);
|
|
@@ -1327,18 +1320,18 @@ class DeviceAta extends EventEmitter {
|
|
|
1327
1320
|
//log current state
|
|
1328
1321
|
if (this.logInfo) {
|
|
1329
1322
|
this.emit('info', `Power: ${power ? 'ON' : 'OFF'}`);
|
|
1330
|
-
this.emit('info', `Target operation mode: ${AirConditioner.
|
|
1331
|
-
this.emit('info', `Current operation mode: ${this.displayMode === 1 ? AirConditioner.
|
|
1323
|
+
this.emit('info', `Target operation mode: ${AirConditioner.OperationModeMapEnumToString[operationMode]}`);
|
|
1324
|
+
this.emit('info', `Current operation mode: ${this.displayMode === 1 ? AirConditioner.CurrentOperationModeHeatherCoolerMapEnumToString[obj.currentOperationMode] : AirConditioner.CurrentOperationModeThermostatMapEnumToString[obj.currentOperationMode]}`);
|
|
1332
1325
|
this.emit('info', `Target temperature: ${setTemperature}${obj.temperatureUnit}`);
|
|
1333
1326
|
this.emit('info', `Current temperature: ${roomTemperature}${obj.temperatureUnit}`);
|
|
1334
1327
|
if (supportsOutdoorTemperature && outdoorTemperature !== null) this.emit('info', `Outdoor temperature: ${outdoorTemperature}${obj.temperatureUnit}`);
|
|
1335
|
-
if (supportsFanSpeed) this.emit('info', `Target fan speed: ${AirConditioner.
|
|
1336
|
-
if (supportsFanSpeed) this.emit('info', `Current fan speed: ${AirConditioner.
|
|
1337
|
-
if (vaneHorizontalDirection !== null) this.emit('info', `Vane horizontal: ${AirConditioner.
|
|
1338
|
-
if (vaneVerticalDirection !== null) this.emit('info', `Vane vertical: ${AirConditioner.
|
|
1339
|
-
if (supportsSwingFunction) this.emit('info', `Air direction: ${AirConditioner.
|
|
1328
|
+
if (supportsFanSpeed) this.emit('info', `Target fan speed: ${AirConditioner.FanSpeedMapEnumToString[setFanSpeed]}`);
|
|
1329
|
+
if (supportsFanSpeed) this.emit('info', `Current fan speed: ${AirConditioner.FanSpeedMapEnumToString[actualFanSpeed]}`);
|
|
1330
|
+
if (vaneHorizontalDirection !== null) this.emit('info', `Vane horizontal: ${AirConditioner.VaneHorizontalDirectionMapEnumToString[vaneHorizontalDirection]}`);
|
|
1331
|
+
if (vaneVerticalDirection !== null) this.emit('info', `Vane vertical: ${AirConditioner.VaneVerticalDirectionMapEnumToString[vaneVerticalDirection]}`);
|
|
1332
|
+
if (supportsSwingFunction) this.emit('info', `Air direction: ${AirConditioner.AirDirectionMapEnumToString[obj.currentSwingMode]}`);
|
|
1340
1333
|
this.emit('info', `Temperature display unit: ${obj.temperatureUnit}`);
|
|
1341
|
-
this.emit('info', `Lock physical controls: ${obj.lockPhysicalControl ? '
|
|
1334
|
+
this.emit('info', `Lock physical controls: ${obj.lockPhysicalControl ? 'Locked' : 'Unlocked'}`);
|
|
1342
1335
|
};
|
|
1343
1336
|
})
|
|
1344
1337
|
.on('success', (success) => this.emit('success', success))
|
package/src/melcloudata.js
CHANGED
|
@@ -191,7 +191,7 @@ class MelCloudAta extends EventEmitter {
|
|
|
191
191
|
};
|
|
192
192
|
};
|
|
193
193
|
|
|
194
|
-
async send(accountType,
|
|
194
|
+
async send(accountType, displayMode, deviceData) {
|
|
195
195
|
try {
|
|
196
196
|
switch (accountType) {
|
|
197
197
|
// ----------------------------------------------------------
|
|
@@ -225,8 +225,7 @@ class MelCloudAta extends EventEmitter {
|
|
|
225
225
|
case 7: // FAN
|
|
226
226
|
break;
|
|
227
227
|
case 8: // AUTO
|
|
228
|
-
deviceData.Device.SetTemperature =
|
|
229
|
-
(deviceData.Device.DefaultCoolingSetTemperature + deviceData.Device.DefaultHeatingSetTemperature) / 2;
|
|
228
|
+
deviceData.Device.SetTemperature = (deviceData.Device.DefaultCoolingSetTemperature + deviceData.Device.DefaultHeatingSetTemperature) / 2;
|
|
230
229
|
break;
|
|
231
230
|
default:
|
|
232
231
|
break;
|
|
@@ -291,10 +290,7 @@ class MelCloudAta extends EventEmitter {
|
|
|
291
290
|
// Set target temp
|
|
292
291
|
switch (displayMode) {
|
|
293
292
|
case 1: // Heater/Cooler
|
|
294
|
-
if (deviceData.Device.OperationMode === 8)
|
|
295
|
-
deviceData.Device.SetTemperature =
|
|
296
|
-
(deviceData.Device.DefaultCoolingSetTemperature + deviceData.Device.DefaultHeatingSetTemperature) / 2;
|
|
297
|
-
}
|
|
293
|
+
if (deviceData.Device.OperationMode === 8) deviceData.Device.SetTemperature = (deviceData.Device.DefaultCoolingSetTemperature + deviceData.Device.DefaultHeatingSetTemperature) / 2;
|
|
298
294
|
break;
|
|
299
295
|
case 2: // Thermostat
|
|
300
296
|
break;
|
|
@@ -303,12 +299,12 @@ class MelCloudAta extends EventEmitter {
|
|
|
303
299
|
}
|
|
304
300
|
|
|
305
301
|
// Convert values to strings
|
|
306
|
-
deviceData.Device.Power = String(deviceData.Device.Power
|
|
307
|
-
deviceData.Device.SetTemperature = String(deviceData.Device.SetTemperature
|
|
308
|
-
deviceData.Device.SetFanSpeed = String(deviceData.Device.SetFanSpeed
|
|
309
|
-
deviceData.Device.OperationMode = AirConditioner.OperationModeMapEnumToString?.[deviceData.Device.OperationMode]
|
|
310
|
-
deviceData.Device.VaneHorizontalDirection = AirConditioner.VaneHorizontalDirectionMapEnumToString?.[deviceData.Device.VaneHorizontalDirection]
|
|
311
|
-
deviceData.Device.VaneVerticalDirection = AirConditioner.VaneVerticalDirectionMapEnumToString?.[deviceData.Device.VaneVerticalDirection]
|
|
302
|
+
deviceData.Device.Power = String(deviceData.Device.Power);
|
|
303
|
+
deviceData.Device.SetTemperature = String(deviceData.Device.SetTemperature);
|
|
304
|
+
deviceData.Device.SetFanSpeed = String(deviceData.Device.SetFanSpeed);
|
|
305
|
+
deviceData.Device.OperationMode = AirConditioner.OperationModeMapEnumToString?.[deviceData.Device.OperationMode];
|
|
306
|
+
deviceData.Device.VaneHorizontalDirection = AirConditioner.VaneHorizontalDirectionMapEnumToString?.[deviceData.Device.VaneHorizontalDirection];
|
|
307
|
+
deviceData.Device.VaneVerticalDirection = AirConditioner.VaneVerticalDirectionMapEnumToString?.[deviceData.Device.VaneVerticalDirection];
|
|
312
308
|
|
|
313
309
|
this.emit('warn', JSON.stringify(deviceData.Device, null, 2));
|
|
314
310
|
|