homebridge-melcloud-control 2.3.0-beta.23 → 2.3.0-beta.25

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.
@@ -205,7 +205,7 @@
205
205
  "required": true
206
206
  },
207
207
  "ataDisplayMode": {
208
- "title": "Control Mode",
208
+ "title": "Control",
209
209
  "type": "integer",
210
210
  "minimum": 0,
211
211
  "maximum": 1,
@@ -224,11 +224,11 @@
224
224
  ]
225
225
  }
226
226
  ],
227
- "description": "Select main control mode.",
227
+ "description": "Select main control mode displayed in HomeKit app.",
228
228
  "required": true
229
229
  },
230
230
  "ataHeatDryFanMode": {
231
- "title": "Heat Mode",
231
+ "title": "Heat",
232
232
  "type": "integer",
233
233
  "minimum": 0,
234
234
  "maximum": 3,
@@ -259,11 +259,46 @@
259
259
  ]
260
260
  }
261
261
  ],
262
- "description": "Operation mode for Heat, if selected Heat and the mode is not supported by device then will be disabled, in other cases will use selected mode.",
262
+ "description": "Select operation mode for Heat, if selected Heat and the mode is not supported by device then will be disabled, in other cases will use selected mode.",
263
+ "required": true
264
+ },
265
+ "ataCoolDryFanMode": {
266
+ "title": "Cool",
267
+ "type": "integer",
268
+ "minimum": 0,
269
+ "maximum": 3,
270
+ "default": 1,
271
+ "oneOf": [
272
+ {
273
+ "title": "None/Disabled",
274
+ "enum": [
275
+ 0
276
+ ]
277
+ },
278
+ {
279
+ "title": "Cool",
280
+ "enum": [
281
+ 1
282
+ ]
283
+ },
284
+ {
285
+ "title": "Dry",
286
+ "enum": [
287
+ 2
288
+ ]
289
+ },
290
+ {
291
+ "title": "Fan",
292
+ "enum": [
293
+ 3
294
+ ]
295
+ }
296
+ ],
297
+ "description": "Select operation mode for Heat, if selected Heat and the mode is not supported by device then will be disabled, in other cases will use selected mode.",
263
298
  "required": true
264
299
  },
265
300
  "ataAutoDryFanMode": {
266
- "title": "Auto Mode",
301
+ "title": "Auto",
267
302
  "type": "integer",
268
303
  "minimum": 0,
269
304
  "maximum": 3,
@@ -294,7 +329,7 @@
294
329
  ]
295
330
  }
296
331
  ],
297
- "description": "Operation mode for Auto, if selected Auto and the mode is not supported by device then will be disabled, in other cases will use selected mode.",
332
+ "description": "Select operation mode for Auto, if selected Auto and the mode is not supported by device then will be disabled, in other cases will use selected mode.",
298
333
  "required": true
299
334
  },
300
335
  "ataPresets": {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "2.3.0-beta.23",
4
+ "version": "2.3.0-beta.25",
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/deviceata.js CHANGED
@@ -22,6 +22,7 @@ class DeviceAta extends EventEmitter {
22
22
  this.temperatureSensorOutdoor = account.ataTemperatureSensorOutdoor || false;
23
23
  this.presetsEnabled = account.ataPresets || false;
24
24
  this.heatDryFanMode = account.ataHeatDryFanMode || 1; //NONE, HEAT, DRY, FAN
25
+ this.coolDryFanMode = account.ataCoolDryFanMode || 1; //NONE, COOL, DRY, FAN
25
26
  this.autoDryFanMode = account.ataAutoDryFanMode || 1; //NONE, AUTO, DRY, FAN
26
27
  this.buttons = account.ataButtons || [];
27
28
  this.disableLogInfo = account.disableLogInfo || false;
@@ -38,9 +39,8 @@ class DeviceAta extends EventEmitter {
38
39
  const mqttEnabled = mqtt.enable || false;
39
40
  this.mqttConnected = false;
40
41
 
41
- //variables
42
+ //function
42
43
  this.melCloud = melCloud; //function
43
- this.startPrepareAccessory = true;
44
44
 
45
45
  //buttons configured
46
46
  this.buttonsConfigured = [];
@@ -63,6 +63,21 @@ class DeviceAta extends EventEmitter {
63
63
  }
64
64
  this.buttonsConfiguredCount = this.buttonsConfigured.length || 0;
65
65
 
66
+ //variables
67
+ this.startPrepareAccessory = true;
68
+ this.power = false;
69
+ this.offline = false;
70
+ this.currentOperationMode = 0;
71
+ this.targetOperationMode = 0;
72
+ this.fanSpeed = 0;
73
+ this.swingMode = 0;
74
+ this.lockPhysicalControls = 0;
75
+
76
+ this.operationModeSetPropsMinValue = 0;
77
+ this.operationModeSetPropsMaxValue = 3;
78
+ this.operationModeSetPropsValidValues = [0];
79
+ this.fanSpeedSetPropsMaxValue = 2;
80
+
66
81
  //melcloud device
67
82
  this.melCloudAta = new MelCloudAta({
68
83
  contextKey: contextKey,
@@ -170,6 +185,7 @@ class DeviceAta extends EventEmitter {
170
185
  const modelSupportsFanSpeed = deviceData.Device.ModelSupportsFanSpeed ?? false;
171
186
  const modelSupportsHeat1 = deviceData.Device.ModelSupportsHeat ?? false;
172
187
  const modelSupportsHeat = this.heatDryFanMode >= 1 && modelSupportsHeat1;
188
+ const modelSupportsCool = this.coolDryFanMode >= 1;
173
189
  const modelSupportsAuto1 = deviceData.Device.ModelSupportsAuto ?? false;
174
190
  const modelSupportsAuto = this.autoDryFanMode >= 1 && modelSupportsAuto1;
175
191
  const modelSupportsDry = deviceData.Device.ModelSupportsDry ?? false;
@@ -209,86 +225,167 @@ class DeviceAta extends EventEmitter {
209
225
  this.presetsCount = this.presetsEnabled ? presets.length : 0;
210
226
 
211
227
  //operating mode
212
- let currentOperationMode = 0;
213
- let targetOperationMode = 0;
214
- let fanSpeed = 0;
215
- let swingMode = 0;
216
- let lockPhysicalControls = 0;
217
-
218
- let operationModeSetPropsMinValue = 0;
219
- let operationModeSetPropsMaxValue = 3;
220
- let operationModeSetPropsValidValues = [0];
221
- let fanSpeedSetPropsMaxValue = 2;
222
-
223
228
  switch (displayMode) {
224
229
  case 0: //Heater Cooler
225
230
  //operating mode 0, HEAT, DRY, COOL, 4, 5, 6, FAN, AUTO, ISEE HEAT, ISEE DRY, ISEE COOL
226
- currentOperationMode = !power ? 0 : inStandbyMode ? 1 : [0, 2, 3, 3, 1, 1, 1, 1, (setTemperature < roomTemperature) ? 3 : 2, 2, 1, 3][operationMode]; //INACTIVE, IDLE, HEATING, COOLING
227
- targetOperationMode = [operationMode, 1, [1, 1, 1, 1][this.heatDryFanMode], 2, 2, 2, 2, [0, 0, 0, 0][this.autoDryFanMode], 0, 1, 1, 2][operationMode]; //AUTO, HEAT, COOL
228
- operationModeSetPropsMinValue = modelSupportsAuto && modelSupportsHeat ? 0 : !modelSupportsAuto && modelSupportsHeat ? 1 : modelSupportsAuto && !modelSupportsHeat ? 0 : 2;
229
- operationModeSetPropsMaxValue = 2
230
- operationModeSetPropsValidValues = modelSupportsAuto && modelSupportsHeat ? [0, 1, 2] : !modelSupportsAuto && modelSupportsHeat ? [1, 2] : modelSupportsAuto && !modelSupportsHeat ? [0, 2] : [2];
231
+ switch (power) {
232
+ case true:
233
+ switch (!inStandbyMode) {
234
+ case true:
235
+ switch (operationMode) {
236
+ case 1: //HEAT
237
+ this.currentOperationMode = 2; //INACTIVE, IDLE, HEATING, COOLING
238
+ this.targetOperationMode = 1; //AUTO, HEAT, COOL
239
+ break;
240
+ case 2: //DRY
241
+ this.currentOperationMode = 3;
242
+ this.targetOperationMode = 2;
243
+ break;
244
+ case 3: //COOL
245
+ this.currentOperationMode = 3;
246
+ this.targetOperationMode = 2;
247
+ break;
248
+ case 7: //FAN
249
+ this.currentOperationMode = 3;
250
+ this.targetOperationMode = 2;
251
+ break;
252
+ case 8: //AUTO
253
+ this.currentOperationMode = setTemperature < roomTemperature ? 3 : 2;
254
+ this.targetOperationMode = 0;
255
+ break;
256
+ case 9: //ISEE HEAT
257
+ this.currentOperationMode = 2
258
+ this.targetOperationMode = 1;
259
+ break;
260
+ case 10: //ISEE DRY
261
+ this.currentOperationMode = 3;
262
+ this.targetOperationMode = 2;
263
+ break;
264
+ case 11: //ISEE COOL;
265
+ this.currentOperationMode = 3;
266
+ this.targetOperationMode = 2;
267
+ break;
268
+ default:
269
+ this.emit('warn', `Unknown operating mode: ${operationMode}`);
270
+ break;
271
+ };
272
+ break;
273
+ case false:
274
+ this.currentOperationMode = 1;
275
+ break;
276
+ };
277
+ break;
278
+ case false:
279
+ this.currentOperationMode = 0;
280
+ this.targetOperationMode = 0;
281
+ break;
282
+ };
283
+ this.operationModeSetPropsMinValue = modelSupportsAuto && modelSupportsHeat ? 0 : !modelSupportsAuto && modelSupportsHeat ? 1 : modelSupportsAuto && !modelSupportsHeat ? 0 : 2;
284
+ this.operationModeSetPropsMaxValue = 2
285
+ this.operationModeSetPropsValidValues = modelSupportsAuto && modelSupportsHeat ? [0, 1, 2] : !modelSupportsAuto && modelSupportsHeat ? [1, 2] : modelSupportsAuto && !modelSupportsHeat ? [0, 2] : [2];
231
286
 
232
287
  //fan speed mode
233
288
  if (modelSupportsFanSpeed) {
234
289
  switch (numberOfFanSpeeds) {
235
290
  case 2: //Fan speed mode 2
236
- fanSpeed = hasAutomaticFanSpeed ? [3, 1, 2][setFanSpeed] : [0, 1, 2][setFanSpeed];
237
- fanSpeedSetPropsMaxValue = hasAutomaticFanSpeed ? 3 : 2;
291
+ this.fanSpeed = hasAutomaticFanSpeed ? [3, 1, 2][setFanSpeed] : [0, 1, 2][setFanSpeed];
292
+ this.fanSpeedSetPropsMaxValue = hasAutomaticFanSpeed ? 3 : 2;
238
293
  break;
239
294
  case 3: //Fan speed mode 3
240
- fanSpeed = hasAutomaticFanSpeed ? [4, 1, 2, 3][setFanSpeed] : [0, 1, 2, 3][setFanSpeed];
241
- fanSpeedSetPropsMaxValue = hasAutomaticFanSpeed ? 4 : 3;
295
+ this.fanSpeed = hasAutomaticFanSpeed ? [4, 1, 2, 3][setFanSpeed] : [0, 1, 2, 3][setFanSpeed];
296
+ this.fanSpeedSetPropsMaxValue = hasAutomaticFanSpeed ? 4 : 3;
242
297
  break;
243
298
  case 4: //Fan speed mode 4
244
- fanSpeed = hasAutomaticFanSpeed ? [5, 1, 2, 3, 4][setFanSpeed] : [0, 1, 2, 3, 4][setFanSpeed];
245
- fanSpeedSetPropsMaxValue = hasAutomaticFanSpeed ? 5 : 4;
299
+ this.fanSpeed = hasAutomaticFanSpeed ? [5, 1, 2, 3, 4][setFanSpeed] : [0, 1, 2, 3, 4][setFanSpeed];
300
+ this.fanSpeedSetPropsMaxValue = hasAutomaticFanSpeed ? 5 : 4;
246
301
  break;
247
302
  case 5: //Fan speed mode 5
248
- fanSpeed = hasAutomaticFanSpeed ? [6, 1, 2, 3, 4, 5][setFanSpeed] : [0, 1, 2, 3, 4, 5][setFanSpeed];
249
- fanSpeedSetPropsMaxValue = hasAutomaticFanSpeed ? 6 : 5;
303
+ this.fanSpeed = hasAutomaticFanSpeed ? [6, 1, 2, 3, 4, 5][setFanSpeed] : [0, 1, 2, 3, 4, 5][setFanSpeed];
304
+ this.fanSpeedSetPropsMaxValue = hasAutomaticFanSpeed ? 6 : 5;
250
305
  break;
251
306
  case 6: //Fan speed mode 6
252
- fanSpeed = hasAutomaticFanSpeed ? [7, 1, 2, 3, 4, 5, 6][setFanSpeed] : [0, 1, 2, 3, 4, 5, 6][setFanSpeed];
253
- fanSpeedSetPropsMaxValue = hasAutomaticFanSpeed ? 7 : 6;
307
+ this.fanSpeed = hasAutomaticFanSpeed ? [7, 1, 2, 3, 4, 5, 6][setFanSpeed] : [0, 1, 2, 3, 4, 5, 6][setFanSpeed];
308
+ this.fanSpeedSetPropsMaxValue = hasAutomaticFanSpeed ? 7 : 6;
254
309
  break;
255
310
  };
256
311
  };
257
312
 
258
313
  //swing and vane mode
259
- swingMode = swingFunction && vaneHorizontal === 12 && vaneVertical === 7 ? 1 : 0;
314
+ this.swingMode = swingFunction && vaneHorizontal === 12 && vaneVertical === 7 ? 1 : 0;
260
315
 
261
316
  //lock physical controls
262
- lockPhysicalControls = prohibitSetTemperature && prohibitOperationMode && prohibitPower ? 1 : 0;
317
+ this.lockPhysicalControls = prohibitSetTemperature && prohibitOperationMode && prohibitPower ? 1 : 0;
263
318
 
264
319
  //update characteristics
265
320
  if (this.melCloudService) {
266
321
  this.melCloudService
267
322
  .updateCharacteristic(Characteristic.Active, power)
268
- .updateCharacteristic(Characteristic.CurrentHeaterCoolerState, currentOperationMode)
269
- .updateCharacteristic(Characteristic.TargetHeaterCoolerState, targetOperationMode)
323
+ .updateCharacteristic(Characteristic.CurrentHeaterCoolerState, this.currentOperationMode)
324
+ .updateCharacteristic(Characteristic.TargetHeaterCoolerState, this.targetOperationMode)
270
325
  .updateCharacteristic(Characteristic.CurrentTemperature, roomTemperature)
271
326
  .updateCharacteristic(Characteristic.HeatingThresholdTemperature, setTemperature)
272
327
  .updateCharacteristic(Characteristic.CoolingThresholdTemperature, setTemperature)
273
- .updateCharacteristic(Characteristic.LockPhysicalControls, lockPhysicalControls)
328
+ .updateCharacteristic(Characteristic.LockPhysicalControls, this.lockPhysicalControls)
274
329
  .updateCharacteristic(Characteristic.TemperatureDisplayUnits, useFahrenheit);
275
- const updateRS = modelSupportsFanSpeed ? this.melCloudService.updateCharacteristic(Characteristic.RotationSpeed, fanSpeed) : false;
276
- const updateSM = swingFunction ? this.melCloudService.updateCharacteristic(Characteristic.SwingMode, swingMode) : false;
330
+ const updateRS = modelSupportsFanSpeed ? this.melCloudService.updateCharacteristic(Characteristic.RotationSpeed, this.fanSpeed) : false;
331
+ const updateSM = swingFunction ? this.melCloudService.updateCharacteristic(Characteristic.SwingMode, this.swingMode) : false;
277
332
  };
278
333
  break;
279
334
  case 1: //Thermostat
280
- //operating mode 0, HEAT, DRY, COOL, 4, 5, 6, FAN, AUTO, ISEE HEAT, ISEE DRY, ISEE COOL
281
- currentOperationMode = !power || inStandbyMode ? 0 : [0, 1, 2, 2, 2, 2, 2, 2, (setTemperature < roomTemperature) ? 2 : 1, 1, 1, 2][operationMode]; //OFF, HEAT, COOL
282
- targetOperationMode = !power || inStandbyMode ? 0 : [0, 1, [1, 1, 1, 1][this.heatDryFanMode], 2, 2, 2, 2, [3, 3, 3, 3][this.autoDryFanMode], 3, 1, 1, 2][operationMode]; //OFF, HEAT, COOL, AUTO
283
- operationModeSetPropsMinValue = 0
284
- operationModeSetPropsMaxValue = modelSupportsAuto && modelSupportsHeat ? 3 : !modelSupportsAuto && modelSupportsHeat ? 2 : modelSupportsAuto && !modelSupportsHeat ? 3 : 2;
285
- operationModeSetPropsValidValues = modelSupportsAuto && modelSupportsHeat ? [0, 1, 2, 3] : !modelSupportsAuto && modelSupportsHeat ? [0, 1, 2] : modelSupportsAuto && !modelSupportsHeat ? [0, 2, 3] : [0, 2];
335
+ switch (power && !inStandbyMode) {
336
+ case true:
337
+ switch (operationMode) {
338
+ case 1: //HEAT
339
+ this.currentOperationMode = 1; //OFF, HEAT, COOL
340
+ this.targetOperationMode = 1; //OFF, HEAT, COOL, AUTO
341
+ break;
342
+ case 2: //DRY
343
+ this.currentOperationMode = 2;
344
+ this.targetOperationMode = 2;
345
+ break;
346
+ case 3: //COOL
347
+ this.currentOperationMode = 2;
348
+ this.targetOperationMode = 2;
349
+ break;
350
+ case 7: //FAN
351
+ this.currentOperationMode = 2;
352
+ this.targetOperationMode = 2;
353
+ break;
354
+ case 8: //AUTO
355
+ this.currentOperationMode = setTemperature < roomTemperature ? 2 : 1;
356
+ this.targetOperationMode = 3;
357
+ break;
358
+ case 9: //ISEE HEAT
359
+ this.currentOperationMode = 1
360
+ this.targetOperationMode = 1;
361
+ break;
362
+ case 10: //ISEE DRY
363
+ this.currentOperationMode = 2;
364
+ this.targetOperationMode = 2;
365
+ break;
366
+ case 11: //ISEE COOL;
367
+ this.currentOperationMode = 2;
368
+ this.targetOperationMode = 2;
369
+ break;
370
+ default:
371
+ this.emit('warn', `Unknown operating mode: ${operationMode}`);
372
+ break;
373
+ };
374
+ break;
375
+ case false:
376
+ this.currentOperationMode = 0;
377
+ this.targetOperationMode = 0;
378
+ break;
379
+ };
380
+ this.operationModeSetPropsMinValue = 0
381
+ this.operationModeSetPropsMaxValue = modelSupportsAuto && modelSupportsHeat ? 3 : !modelSupportsAuto && modelSupportsHeat ? 2 : modelSupportsAuto && !modelSupportsHeat ? 3 : 2;
382
+ this.operationModeSetPropsValidValues = modelSupportsAuto && modelSupportsHeat ? [0, 1, 2, 3] : !modelSupportsAuto && modelSupportsHeat ? [0, 1, 2] : modelSupportsAuto && !modelSupportsHeat ? [0, 2, 3] : [0, 2];
286
383
 
287
384
  //update characteristics
288
385
  if (this.melCloudService) {
289
386
  this.melCloudService
290
- .updateCharacteristic(Characteristic.CurrentHeatingCoolingState, currentOperationMode)
291
- .updateCharacteristic(Characteristic.TargetHeatingCoolingState, targetOperationMode)
387
+ .updateCharacteristic(Characteristic.CurrentHeatingCoolingState, this.currentOperationMode)
388
+ .updateCharacteristic(Characteristic.TargetHeatingCoolingState, this.targetOperationMode)
292
389
  .updateCharacteristic(Characteristic.CurrentTemperature, roomTemperature)
293
390
  .updateCharacteristic(Characteristic.TargetTemperature, setTemperature)
294
391
  .updateCharacteristic(Characteristic.TemperatureDisplayUnits, useFahrenheit);
@@ -298,17 +395,12 @@ class DeviceAta extends EventEmitter {
298
395
 
299
396
  this.power = power;
300
397
  this.offline = offline;
301
- this.currentOperationMode = currentOperationMode;
302
- this.targetOperationMode = targetOperationMode;
303
398
  this.roomTemperature = roomTemperature;
304
399
  this.outdoorTemperature = outdoorTemperature;
305
400
  this.setTemperature = setTemperature;
306
- this.fanSpeed = fanSpeed;
307
401
  this.setFanSpeed = setFanSpeed;
308
- this.swingMode = swingMode;
309
402
  this.vaneHorizontal = vaneHorizontal;
310
403
  this.vaneVertical = vaneVertical;
311
- this.lockPhysicalControls = lockPhysicalControls;
312
404
 
313
405
  if (this.roomTemperatureSensorService) {
314
406
  this.roomTemperatureSensorService
@@ -420,7 +512,7 @@ class DeviceAta extends EventEmitter {
420
512
  button.state = power ? (setFanSpeed === 6) : false;
421
513
  break;
422
514
  case 37: //PHYSICAL LOCK CONTROLS ALL
423
- button.state = (lockPhysicalControls === 1);
515
+ button.state = (this.lockPhysicalControls === 1);
424
516
  break;
425
517
  case 38: //PHYSICAL LOCK CONTROLS POWER
426
518
  button.state = (prohibitPower === true);
@@ -477,19 +569,14 @@ class DeviceAta extends EventEmitter {
477
569
  const info1 = displayMode === 0 ? this.emit('message', `Heating threshold temperature: ${setTemperature}${this.temperatureUnit}`) : false;
478
570
  const info2 = displayMode === 0 ? this.emit('message', `Cooling threshold temperature: ${setTemperature}${this.temperatureUnit}`) : false;
479
571
  const info3 = modelSupportsFanSpeed ? this.emit('message', `Fan speed mode: ${CONSTANTS.AirConditioner.FanSpeed[setFanSpeed]}`) : false;
480
- const info4 = swingFunction ? this.emit('message', `Vane swing mode: ${CONSTANTS.AirConditioner.AirDirection[swingMode ? 6 : 0]}`) : false;
572
+ const info4 = swingFunction ? this.emit('message', `Vane swing mode: ${CONSTANTS.AirConditioner.AirDirection[this.swingMode ? 6 : 0]}`) : false;
481
573
  this.emit('message', `Temperature display unit: ${this.temperatureUnit}`);
482
- this.emit('message', `Lock physical controls: ${lockPhysicalControls ? 'LOCKED' : 'UNLOCKED'}`);
574
+ this.emit('message', `Lock physical controls: ${this.lockPhysicalControls ? 'LOCKED' : 'UNLOCKED'}`);
483
575
  };
484
576
 
485
577
  //start prepare accessory
486
578
  if (this.startPrepareAccessory) {
487
579
  try {
488
- this.operationModeSetPropsMinValue = operationModeSetPropsMinValue;
489
- this.operationModeSetPropsMaxValue = operationModeSetPropsMaxValue;
490
- this.operationModeSetPropsValidValues = operationModeSetPropsValidValues;
491
- this.fanSpeedSetPropsMaxValue = fanSpeedSetPropsMaxValue;
492
-
493
580
  const accessory = await this.prepareAccessory(accountInfo, deviceState, deviceId, deviceTypeText, deviceName, accountName);
494
581
  this.emit('publishAccessory', accessory);
495
582
  this.startPrepareAccessory = false;
@@ -623,8 +710,9 @@ class DeviceAta extends EventEmitter {
623
710
  const numberOfFanSpeeds = this.numberOfFanSpeeds;
624
711
  const swingFunction = this.swingFunction;
625
712
  const hasOutdoorTemperature = this.hasOutdoorTemperature;
626
- const heatDryFanMode = [deviceState.OperationMode, 8, modelSupportsDry ? 2 : deviceState.OperationMode, 7][this.heatDryFanMode]; //NONE, HEAT - 1, DRY - 2, FAN - 7
627
- const autoDryFanMode = [deviceState.OperationMode, 1, modelSupportsDry ? 2 : deviceState.OperationMode, 7][this.autoDryFanMode]; //NONE, AUTO - 8, DRY - 2, FAN - 7
713
+ const heatDryFanMode = [deviceState.OperationMode, 1, modelSupportsDry ? 2 : deviceState.OperationMode, 7][this.heatDryFanMode]; //NONE, HEAT - 1, DRY - 2, FAN - 7
714
+ const coolDryFanMode = [deviceState.OperationMode, 3, modelSupportsDry ? 2 : deviceState.OperationMode, 7][this.heatDryFanMode]; //NONE, COOL - 1, DRY - 2, FAN - 7
715
+ const autoDryFanMode = [deviceState.OperationMode, 8, modelSupportsDry ? 2 : deviceState.OperationMode, 7][this.autoDryFanMode]; //NONE, AUTO - 8, DRY - 2, FAN - 7
628
716
  const serviceName = `${deviceTypeText} ${accessoryName}`;
629
717
 
630
718
  switch (displayMode) {
@@ -677,7 +765,7 @@ class DeviceAta extends EventEmitter {
677
765
  break;
678
766
  case 2: //COOL - COOL
679
767
  deviceState.Power = true;
680
- deviceState.OperationMode = 3;
768
+ deviceState.OperationMode = coolDryFanMode;
681
769
  deviceState.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Power + CONSTANTS.AirConditioner.EffectiveFlags.OperationMode;
682
770
  break;
683
771
  };
@@ -872,7 +960,7 @@ class DeviceAta extends EventEmitter {
872
960
  break;
873
961
  case 2: //COOL - COOL
874
962
  deviceState.Power = true;
875
- deviceState.OperationMode = 3;
963
+ deviceState.OperationMode = coolDryFanMode;
876
964
  deviceState.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Power + CONSTANTS.AirConditioner.EffectiveFlags.OperationMode;
877
965
  break;
878
966
  case 3: //AUTO - AUTO
@@ -14,7 +14,7 @@ class MelCloudAta extends EventEmitter {
14
14
  const accountInfoFile = config.accountInfoFile;
15
15
  const deviceInfoFile = config.deviceInfoFile;
16
16
  const debugLog = config.debugLog;
17
- const refreshInterval= config.refreshInterval;
17
+ const refreshInterval = config.refreshInterval;
18
18
 
19
19
  //set default values
20
20
  this.deviceData = {};
@@ -127,13 +127,13 @@ class MelCloudAta extends EventEmitter {
127
127
  const legacyDevice = device.LegacyDevice;
128
128
  const unitSupportsStandbyMode = device.UnitSupportsStandbyMode;
129
129
  const isSplitSystem = device.IsSplitSystem;
130
- const hasHalfDegreeIncrements = device.HasHalfDegreeIncrements ?? false;
131
- const hasOutdoorTemperature = device.HasOutdoorTemperature ?? false
130
+ const hasHalfDegreeIncrements = device.HasHalfDegreeIncrements;
131
+ const hasOutdoorTemperature = device.HasOutdoorTemperature;
132
132
  const modelIsAirCurtain = device.ModelIsAirCurtain;
133
- const modelSupportsFanSpeed = device.ModelSupportsFanSpeed ?? false;
134
- const modelSupportsAuto = device.ModelSupportsAuto ?? false;
135
- const modelSupportsHeat = device.ModelSupportsHeat ?? false;
136
- const modelSupportsDry = device.ModelSupportsDry ?? false;
133
+ const modelSupportsFanSpeed = device.ModelSupportsFanSpeed;
134
+ const modelSupportsAuto = device.ModelSupportsAuto;
135
+ const modelSupportsHeat = device.ModelSupportsHeat;
136
+ const modelSupportsDry = device.ModelSupportsDry;
137
137
  const modelSupportsVaneVertical = device.ModelSupportsVaneVertical;
138
138
  const modelSupportsVaneHorizontal = device.ModelSupportsVaneHorizontal;
139
139
  const modelSupportsWideVane = device.ModelSupportsWideVane;