homebridge-melcloud-control 4.2.3-beta.53 → 4.2.3-beta.55

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/src/deviceatw.js CHANGED
@@ -173,93 +173,93 @@ class DeviceAtw extends EventEmitter {
173
173
  async setOverExternalIntegration(integration, deviceData, key, value) {
174
174
  try {
175
175
  let set = false
176
- let effectiveFlags = null;
176
+ let flag = null;
177
177
  switch (key) {
178
178
  case 'Power':
179
179
  deviceData.Device[key] = value;
180
- effectiveFlags = HeatPump.EffectiveFlags.Power;
180
+ flag = HeatPump.EffectiveFlags.Power;
181
181
  break;
182
182
  case 'OperationMode':
183
183
  deviceData.Device[key] = value;
184
- effectiveFlags = HeatPump.EffectiveFlags.OperationMode;
184
+ flag = HeatPump.EffectiveFlags.OperationMode;
185
185
  break;
186
186
  case 'OperationModeZone1':
187
187
  deviceData.Device[key] = value;
188
- effectiveFlags = HeatPump.EffectiveFlags.OperationModeZone1;
188
+ flag = HeatPump.EffectiveFlags.OperationModeZone1;
189
189
  break;
190
190
  case 'OperationModeZone2':
191
191
  deviceData.Device[key] = value;
192
- effectiveFlags = HeatPump.EffectiveFlags.OperationModeZone2;
192
+ flag = HeatPump.EffectiveFlags.OperationModeZone2;
193
193
  break;
194
194
  case 'SetTemperatureZone1':
195
195
  deviceData.Device[key] = value;
196
- effectiveFlags = HeatPump.EffectiveFlags.SetTemperatureZone2;
196
+ flag = HeatPump.EffectiveFlags.SetTemperatureZone2;
197
197
  break;
198
198
  case 'SetTemperatureZone2':
199
199
  deviceData.Device[key] = value;
200
- effectiveFlags = HeatPump.EffectiveFlags.SetTemperatureZone2;
200
+ flag = HeatPump.EffectiveFlags.SetTemperatureZone2;
201
201
  break;
202
202
  case 'SetHeatFlowTemperatureZone1':
203
203
  deviceData.Device[key] = value;
204
- effectiveFlags = HeatPump.EffectiveFlags.SetHeatFlowTemperatureZone1;
204
+ flag = HeatPump.EffectiveFlags.SetHeatFlowTemperatureZone1;
205
205
  break;
206
206
  case 'SetHeatFlowTemperatureZone2':
207
207
  deviceData.Device[key] = value;
208
- effectiveFlags = HeatPump.EffectiveFlags.SetHeatFlowTemperatureZone2;
208
+ flag = HeatPump.EffectiveFlags.SetHeatFlowTemperatureZone2;
209
209
  break;
210
210
  case 'SetCoolFlowTemperatureZone1':
211
211
  deviceData.Device[key] = value;
212
- effectiveFlags = HeatPump.EffectiveFlags.SetCoolFlowTemperatureZone1;
212
+ flag = HeatPump.EffectiveFlags.SetCoolFlowTemperatureZone1;
213
213
  break;
214
214
  case 'SetCoolFlowTemperatureZone2':
215
215
  deviceData.Device[key] = value;
216
- effectiveFlags = HeatPump.EffectiveFlags.SetCoolFlowTemperatureZone2;
216
+ flag = HeatPump.EffectiveFlags.SetCoolFlowTemperatureZone2;
217
217
  break;
218
218
  case 'SetTankWaterTemperature':
219
219
  deviceData.Device[key] = value;
220
- effectiveFlags = HeatPump.EffectiveFlags.SetTankWaterTemperature;
220
+ flag = HeatPump.EffectiveFlags.SetTankWaterTemperature;
221
221
  break;
222
222
  case 'ForcedHotWaterMode':
223
223
  deviceData.Device[key] = value;
224
- effectiveFlags = HeatPump.EffectiveFlags.ForcedHotWaterMode;
224
+ flag = HeatPump.EffectiveFlags.ForcedHotWaterMode;
225
225
  break;
226
226
  case 'EcoHotWater':
227
227
  deviceData.Device[key] = value;
228
- effectiveFlags = HeatPump.EffectiveFlags.EcoHotWater;
228
+ flag = HeatPump.EffectiveFlags.EcoHotWater;
229
229
  break;
230
230
  case 'ProhibitZone1':
231
231
  if (this.accountType === 'melcloudhome') return;
232
232
 
233
233
  deviceData.Device[key] = value;
234
- effectiveFlags = HeatPump.EffectiveFlags.ProhibitZone1;
234
+ flag = HeatPump.EffectiveFlags.ProhibitZone1;
235
235
  break;
236
236
  case 'ProhibitZone2':
237
237
  if (this.accountType === 'melcloudhome') return;
238
238
 
239
239
  deviceData.Device[key] = value;
240
- effectiveFlags = HeatPump.EffectiveFlags.ProhibitZone2;
240
+ flag = HeatPump.EffectiveFlags.ProhibitZone2;
241
241
  break;
242
242
  case 'ProhibitHotWater':
243
243
  if (this.accountType === 'melcloudhome') return;
244
244
 
245
245
  deviceData.Device[key] = value;
246
- effectiveFlags = HeatPump.EffectiveFlags.ProhibitHotWater;
246
+ flag = HeatPump.EffectiveFlags.ProhibitHotWater;
247
247
  break;
248
248
  case 'ScheduleEnabled':
249
249
  if (this.accountType === 'melcloud') return;
250
250
 
251
251
  deviceData.Device[key].Enabled = value;
252
- effectiveFlags = 'schedule';
252
+ flag = 'schedule';
253
253
  break;
254
254
  case 'HolidayMode':
255
255
  if (this.accountType === 'melcloud') {
256
256
  deviceData.Device[key] = value;
257
- effectiveFlags = HeatPump.EffectiveFlags.HolidayMode;
257
+ flag = HeatPump.EffectiveFlags.HolidayMode;
258
258
  }
259
259
 
260
260
  if (this.accountType === 'melcloudhome') {
261
261
  deviceData.Device[key].Enabled = value;
262
- effectiveFlags = 'holidaymode';
262
+ flag = 'holidaymode';
263
263
  }
264
264
  break;
265
265
  default:
@@ -267,7 +267,7 @@ class DeviceAtw extends EventEmitter {
267
267
  break;
268
268
  };
269
269
 
270
- set = await this.melCloudAtw.send(this.accountType, this.displayType, deviceData, effectiveFlags);
270
+ set = await this.melCloudAtw.send(this.accountType, this.displayType, deviceData, flag);
271
271
  return set;
272
272
  } catch (error) {
273
273
  throw new Error(`${integration} set key: ${key}, value: ${value}, error: ${error.message ?? error}`);
@@ -346,7 +346,7 @@ class DeviceAtw extends EventEmitter {
346
346
  case 0: //Heat Pump
347
347
  deviceData.Device.Power = state ? true : false;
348
348
  await this.melCloudAtw.send(this.accountType, this.displayType, deviceData, HeatPump.EffectiveFlags.Power);
349
- if (this.logInfo) this.emit('info', `${zoneName}, Set power: ${state ? 'ON' : 'OFF'}`);
349
+ if (this.logInfo) this.emit('info', `${zoneName}, Set power: ${state ? 'On' : 'Off'}`);
350
350
  break;
351
351
  };
352
352
  } catch (error) {
@@ -371,23 +371,23 @@ class DeviceAtw extends EventEmitter {
371
371
  .onSet(async (value) => {
372
372
  try {
373
373
  let operationModeText = '';
374
- let effectiveFlags = null;
374
+ let flag = null;
375
375
  switch (i) {
376
376
  case caseHeatPump: //Heat Pump - ON, HEAT, COOL
377
377
  switch (value) {
378
378
  case caseHeatPump: //AUTO
379
379
  deviceData.Device.Power = true;
380
- effectiveFlags = HeatPump.EffectiveFlags.Power;
380
+ flag = HeatPump.EffectiveFlags.Power;
381
381
  break;
382
382
  case 1: //HEAT
383
383
  deviceData.Device.Power = true;
384
384
  deviceData.Device.UnitStatus = 0;
385
- effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationMode;
385
+ flag = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationMode;
386
386
  break;
387
387
  case 2: //COOL
388
388
  deviceData.Device.Power = true;
389
389
  deviceData.Device.UnitStatus = 1;
390
- effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationMode;
390
+ flag = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationMode;
391
391
  break;
392
392
  };
393
393
  operationModeText = [HeatPump.SystemMapEnumToString[0], HeatPump.SystemMapEnumToString[deviceData.Device.UnitStatus]][this.accessory.power];
@@ -396,15 +396,15 @@ class DeviceAtw extends EventEmitter {
396
396
  switch (value) {
397
397
  case 0: //AUTO - HEAT CURVE
398
398
  deviceData.Device.OperationModeZone1 = 2;
399
- effectiveFlags = HeatPump.EffectiveFlags.OperationModeZone1;
399
+ flag = HeatPump.EffectiveFlags.OperationModeZone1;
400
400
  break;
401
401
  case 1: //HEAT - HEAT THERMOSTAT / COOL THERMOSTAT
402
402
  deviceData.Device.OperationModeZone1 = [0, 3][this.unitStatus];
403
- effectiveFlags = HeatPump.EffectiveFlags.OperationModeZone1;
403
+ flag = HeatPump.EffectiveFlags.OperationModeZone1;
404
404
  break;
405
405
  case 2: //COOL - HEAT FLOW / COOL FLOW
406
406
  deviceData.Device.OperationModeZone1 = [1, 4][this.unitStatus];
407
- effectiveFlags = HeatPump.EffectiveFlags.OperationModeZone1;
407
+ flag = HeatPump.EffectiveFlags.OperationModeZone1;
408
408
  break;
409
409
  };
410
410
  operationModeText = HeatPump.ZoneOperation[deviceData.Device.OperationModeZone1];
@@ -413,15 +413,15 @@ class DeviceAtw extends EventEmitter {
413
413
  switch (value) {
414
414
  case 0: //AUTO
415
415
  deviceData.Device.ForcedHotWaterMode = false;
416
- effectiveFlags = HeatPump.EffectiveFlags.ForcedHotWaterMode;
416
+ flag = HeatPump.EffectiveFlags.ForcedHotWaterMode;
417
417
  break;
418
418
  case 1: //HEAT
419
419
  deviceData.Device.ForcedHotWaterMode = true;
420
- effectiveFlags = HeatPump.EffectiveFlags.ForcedHotWaterMode;
420
+ flag = HeatPump.EffectiveFlags.ForcedHotWaterMode;
421
421
  break;
422
422
  case 2: //COOL
423
423
  deviceData.Device.ForcedHotWaterMode = false;
424
- effectiveFlags = HeatPump.EffectiveFlags.ForcedHotWaterMode;
424
+ flag = HeatPump.EffectiveFlags.ForcedHotWaterMode;
425
425
  break
426
426
  };
427
427
  operationModeText = deviceData.Device.OperationMode === 1 ? HeatPump.ForceDhwMapEnumToString[1] : HeatPump.ForceDhwMapEnumToString[deviceData.Device.ForcedHotWaterMode ? 1 : 0];
@@ -430,22 +430,22 @@ class DeviceAtw extends EventEmitter {
430
430
  switch (value) {
431
431
  case 0: //AUTO
432
432
  deviceData.Device.OperationModeZone2 = 2;
433
- effectiveFlags = HeatPump.EffectiveFlags.OperationModeZone2;
433
+ flag = HeatPump.EffectiveFlags.OperationModeZone2;
434
434
  break;
435
435
  case 1: //HEAT - HEAT THERMOSTAT / COOL THERMOSTAT
436
436
  deviceData.Device.OperationModeZone2 = [0, 3][this.unitStatus];
437
- effectiveFlags = HeatPump.EffectiveFlags.OperationModeZone2;
437
+ flag = HeatPump.EffectiveFlags.OperationModeZone2;
438
438
  break;
439
439
  case 2: //COOL - HEAT FLOW / COOL FLOW
440
440
  deviceData.Device.OperationModeZone2 = [1, 4][this.unitStatus];
441
- effectiveFlags = HeatPump.EffectiveFlags.OperationModeZone2;
441
+ flag = HeatPump.EffectiveFlags.OperationModeZone2;
442
442
  break;
443
443
  };
444
444
  operationModeText = HeatPump.ZoneOperationMapEnumToString[deviceData.Device.OperationModeZone2];
445
445
  break;
446
446
  };
447
447
 
448
- await this.melCloudAtw.send(this.accountType, this.displayType, deviceData, effectiveFlags);
448
+ await this.melCloudAtw.send(this.accountType, this.displayType, deviceData, flag);
449
449
  if (this.logInfo) this.emit('info', `${zoneName}, Set operation mode: ${operationModeText}`);
450
450
  } catch (error) {
451
451
  if (this.logWarn) this.emit('warn', `${zoneName}, Set operation mode error: ${error}`);
@@ -475,51 +475,51 @@ class DeviceAtw extends EventEmitter {
475
475
  })
476
476
  .onSet(async (value) => {
477
477
  try {
478
- let effectiveFlags = null;
478
+ let flag = null;
479
479
  switch (i) {
480
480
  case caseHeatPump: //Heat Pump
481
481
  //deviceData.Device.SetTemperatureZone1 = value;
482
- //effectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetTemperatureZone1;
482
+ //flag = CONSTANTS.HeatPump.EffectiveFlags.SetTemperatureZone1;
483
483
  break;
484
484
  case caseZone1: //Zone 1
485
485
  switch (zone.operationMode) {
486
486
  case 1: //HEAT FLOW
487
487
  deviceData.Device.SetHeatFlowTemperatureZone1 = value;
488
- effectiveFlags = HeatPump.EffectiveFlags.SetHeatFlowTemperatureZone1;
488
+ flag = HeatPump.EffectiveFlags.SetHeatFlowTemperatureZone1;
489
489
  break;
490
490
  case 4: //COOL FLOW
491
491
  deviceData.Device.SetCoolFlowTemperatureZone1 = value;
492
- effectiveFlags = HeatPump.EffectiveFlags.SetCoolFlowTemperatureZone1;
492
+ flag = HeatPump.EffectiveFlags.SetCoolFlowTemperatureZone1;
493
493
  break;
494
494
  default:
495
495
  deviceData.Device.SetTemperatureZone1 = value;
496
- effectiveFlags = HeatPump.EffectiveFlags.SetTemperatureZone1;
496
+ flag = HeatPump.EffectiveFlags.SetTemperatureZone1;
497
497
  break
498
498
  };
499
499
  break;
500
500
  case caseHotWater: //Hot Water
501
501
  deviceData.Device.SetTankWaterTemperature = value;
502
- effectiveFlags = HeatPump.EffectiveFlags.SetTankWaterTemperature;
502
+ flag = HeatPump.EffectiveFlags.SetTankWaterTemperature;
503
503
  break;
504
504
  case caseZone2: //Zone 2
505
505
  switch (zone.operationMode) {
506
506
  case 1: //HEAT FLOW
507
507
  deviceData.Device.SetHeatFlowTemperatureZone2 = value;
508
- effectiveFlags = HeatPump.EffectiveFlags.SetHeatFlowTemperatureZone2;
508
+ flag = HeatPump.EffectiveFlags.SetHeatFlowTemperatureZone2;
509
509
  break;
510
510
  case 4: //COOL FLOW
511
511
  deviceData.Device.SetCoolFlowTemperatureZone2 = value;
512
- effectiveFlags = HeatPump.EffectiveFlags.SetCoolFlowTemperatureZone2;
512
+ flag = HeatPump.EffectiveFlags.SetCoolFlowTemperatureZone2;
513
513
  break;
514
514
  default:
515
515
  deviceData.Device.SetTemperatureZone2 = value;
516
- effectiveFlags = HeatPump.EffectiveFlags.SetTemperatureZone2;
516
+ flag = HeatPump.EffectiveFlags.SetTemperatureZone2;
517
517
  break
518
518
  };
519
519
  break;
520
520
  };
521
521
 
522
- if (i > 0) await this.melCloudAtw.send(this.accountType, this.displayType, deviceData, effectiveFlags);
522
+ if (i > 0) await this.melCloudAtw.send(this.accountType, this.displayType, deviceData, flag);
523
523
  if (this.logInfo && i !== 0) this.emit('info', `${zoneName}, Set cooling threshold temperature: ${value}${this.accessory.temperatureUnit}`);
524
524
  } catch (error) {
525
525
  if (this.logWarn) this.emit('warn', `${zoneName}, Set cooling threshold temperature error: ${error}`);
@@ -540,51 +540,51 @@ class DeviceAtw extends EventEmitter {
540
540
  })
541
541
  .onSet(async (value) => {
542
542
  try {
543
- let effectiveFlags = null;
543
+ let flag = null;
544
544
  switch (i) {
545
545
  case caseHeatPump: //Heat Pump
546
546
  //deviceData.Device.SetTemperatureZone1 = value;
547
- //effectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetTemperatureZone1;
547
+ //flag = CONSTANTS.HeatPump.EffectiveFlags.SetTemperatureZone1;
548
548
  break;
549
549
  case caseZone1: //Zone 1
550
550
  switch (zone.operationMode) {
551
551
  case 1: //HEAT FLOW
552
552
  deviceData.Device.SetHeatFlowTemperatureZone1 = value;
553
- effectiveFlags = HeatPump.EffectiveFlags.SetHeatFlowTemperatureZone1;
553
+ flag = HeatPump.EffectiveFlags.SetHeatFlowTemperatureZone1;
554
554
  break;
555
555
  case 4: //COOL FLOW
556
556
  deviceData.Device.SetCoolFlowTemperatureZone1 = value;
557
- effectiveFlags = HeatPump.EffectiveFlags.SetCoolFlowTemperatureZone1;
557
+ flag = HeatPump.EffectiveFlags.SetCoolFlowTemperatureZone1;
558
558
  break;
559
559
  default:
560
560
  deviceData.Device.SetTemperatureZone1 = value;
561
- effectiveFlags = HeatPump.EffectiveFlags.SetTemperatureZone1;
561
+ flag = HeatPump.EffectiveFlags.SetTemperatureZone1;
562
562
  break
563
563
  };
564
564
  break;
565
565
  case caseHotWater: //Hot Water
566
566
  deviceData.Device.SetTankWaterTemperature = value;
567
- effectiveFlags = HeatPump.EffectiveFlags.SetTankWaterTemperature;
567
+ flag = HeatPump.EffectiveFlags.SetTankWaterTemperature;
568
568
  break;
569
569
  case caseZone2: //Zone 2
570
570
  switch (zone.operationMode) {
571
571
  case 1: //HEAT FLOW
572
572
  deviceData.Device.SetHeatFlowTemperatureZone2 = value;
573
- effectiveFlags = HeatPump.EffectiveFlags.SetHeatFlowTemperatureZone2;
573
+ flag = HeatPump.EffectiveFlags.SetHeatFlowTemperatureZone2;
574
574
  break;
575
575
  case 4: //COOL FLOW
576
576
  deviceData.Device.SetCoolFlowTemperatureZone2 = value;
577
- effectiveFlags = HeatPump.EffectiveFlags.SetCoolFlowTemperatureZone2;
577
+ flag = HeatPump.EffectiveFlags.SetCoolFlowTemperatureZone2;
578
578
  break;
579
579
  default:
580
580
  deviceData.Device.SetTemperatureZone2 = value;
581
- effectiveFlags = HeatPump.EffectiveFlags.SetTemperatureZone2;
581
+ flag = HeatPump.EffectiveFlags.SetTemperatureZone2;
582
582
  break
583
583
  };
584
584
  break;
585
585
  };
586
586
 
587
- if (i > 0) await this.melCloudAtw.send(this.accountType, this.displayType, deviceData, effectiveFlags);
587
+ if (i > 0) await this.melCloudAtw.send(this.accountType, this.displayType, deviceData, flag);
588
588
  if (this.logInfo && i !== 0) this.emit('info', `${zoneName}, Set heating threshold temperature: ${value}${this.accessory.temperatureUnit}`);
589
589
  } catch (error) {
590
590
  if (this.logWarn) this.emit('warn', `${zoneName}, Set heating threshold temperature error: ${error}`);
@@ -670,27 +670,27 @@ class DeviceAtw extends EventEmitter {
670
670
  .onSet(async (value) => {
671
671
  try {
672
672
  let operationModeText = '';
673
- let effectiveFlags = null;
673
+ let flag = null;
674
674
  switch (i) {
675
675
  case caseHeatPump: //Heat Pump - HEAT, COOL
676
676
  switch (value) {
677
677
  case 0: //OFF
678
678
  deviceData.Device.Power = false;
679
- effectiveFlags = HeatPump.EffectiveFlags.Power;
679
+ flag = HeatPump.EffectiveFlags.Power;
680
680
  break;
681
681
  case 1: //HEAT
682
682
  deviceData.Device.Power = true;
683
683
  deviceData.Device.UnitStatus = 0;
684
- effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationMode;
684
+ flag = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationMode;
685
685
  break;
686
686
  case 2: //COOL
687
687
  deviceData.Device.Power = true;
688
688
  deviceData.Device.UnitStatus = 1;
689
- effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationMode;
689
+ flag = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationMode;
690
690
  break;
691
691
  case 3: //AUTO
692
692
  deviceData.Device.Power = true;
693
- effectiveFlags = HeatPump.EffectiveFlags.Power;
693
+ flag = HeatPump.EffectiveFlags.Power;
694
694
  break;
695
695
  };
696
696
  operationModeText = [HeatPump.SystemMapEnumToString[0], HeatPump.SystemMapEnumToString[deviceData.Device.UnitStatus]][this.accessory.power];
@@ -699,19 +699,19 @@ class DeviceAtw extends EventEmitter {
699
699
  switch (value) {
700
700
  case 0: //OFF - HEAT CURVE
701
701
  deviceData.Device.OperationModeZone1 = 2;
702
- effectiveFlags = HeatPump.EffectiveFlags.OperationModeZone1;
702
+ flag = HeatPump.EffectiveFlags.OperationModeZone1;
703
703
  break;
704
704
  case 1: //HEAT - HEAT THERMOSTAT / COOL THERMOSTAT
705
705
  deviceData.Device.OperationModeZone1 = [0, 3][this.unitStatus];
706
- effectiveFlags = HeatPump.EffectiveFlags.OperationModeZone1;
706
+ flag = HeatPump.EffectiveFlags.OperationModeZone1;
707
707
  break;
708
708
  case 2: //COOL - HEAT FLOW / COOL FLOW
709
709
  deviceData.Device.OperationModeZone1 = [1, 4][this.unitStatus];
710
- effectiveFlags = HeatPump.EffectiveFlags.OperationModeZone1;
710
+ flag = HeatPump.EffectiveFlags.OperationModeZone1;
711
711
  break;
712
712
  case 3: //AUTO - HEAT CURVE
713
713
  deviceData.Device.OperationModeZone1 = 2;
714
- effectiveFlags = HeatPump.EffectiveFlags.OperationModeZone1;
714
+ flag = HeatPump.EffectiveFlags.OperationModeZone1;
715
715
  break;
716
716
  };
717
717
  operationModeText = HeatPump.ZoneOperationMapEnumToString[deviceData.Device.OperationModeZone1];
@@ -720,19 +720,19 @@ class DeviceAtw extends EventEmitter {
720
720
  switch (value) {
721
721
  case 0: //OFF
722
722
  deviceData.Device.ForcedHotWaterMode = false;
723
- effectiveFlags = HeatPump.EffectiveFlags.ForcedHotWaterMode;
723
+ flag = HeatPump.EffectiveFlags.ForcedHotWaterMode;
724
724
  break;
725
725
  case 1: //HEAT
726
726
  deviceData.Device.ForcedHotWaterMode = true;
727
- effectiveFlags = HeatPump.EffectiveFlags.ForcedHotWaterMode;
727
+ flag = HeatPump.EffectiveFlags.ForcedHotWaterMode;
728
728
  break;
729
729
  case 2: //COOL
730
730
  deviceData.Device.ForcedHotWaterMode = false;
731
- effectiveFlags = HeatPump.EffectiveFlags.ForcedHotWaterMode;
731
+ flag = HeatPump.EffectiveFlags.ForcedHotWaterMode;
732
732
  break;
733
733
  case 3: //AUTO
734
734
  deviceData.Device.ForcedHotWaterMode = false;
735
- effectiveFlags = HeatPump.EffectiveFlags.ForcedHotWaterMode;
735
+ flag = HeatPump.EffectiveFlags.ForcedHotWaterMode;
736
736
  break;
737
737
  };
738
738
  operationModeText = deviceData.Device.OperationMode === 1 ? HeatPump.ForceDhwMapEnumToString[1] : HeatPump.ForceDhwMapEnumToString[deviceData.Device.ForcedHotWaterMode ? 1 : 0];
@@ -741,26 +741,26 @@ class DeviceAtw extends EventEmitter {
741
741
  switch (value) {
742
742
  case 0: //OFF - HEAT CURVE
743
743
  deviceData.Device.OperationModeZone2 = 2;
744
- effectiveFlags = HeatPump.EffectiveFlags.OperationModeZone2;
744
+ flag = HeatPump.EffectiveFlags.OperationModeZone2;
745
745
  break;
746
746
  case 1: //HEAT - HEAT THERMOSTAT / COOL THERMOSTAT
747
747
  deviceData.Device.OperationModeZone2 = [0, 3][this.unitStatus];
748
- effectiveFlags = HeatPump.EffectiveFlags.OperationModeZone2;
748
+ flag = HeatPump.EffectiveFlags.OperationModeZone2;
749
749
  break;
750
750
  case 2: //COOL - HEAT FLOW / COOL FLOW
751
751
  deviceData.Device.OperationModeZone2 = [1, 4][this.unitStatus];
752
- effectiveFlags = HeatPump.EffectiveFlags.OperationModeZone2;
752
+ flag = HeatPump.EffectiveFlags.OperationModeZone2;
753
753
  break;
754
754
  case 3: //AUTO - HEAT CURVE
755
755
  deviceData.Device.OperationModeZone2 = 2;
756
- effectiveFlags = HeatPump.EffectiveFlags.OperationModeZone2;
756
+ flag = HeatPump.EffectiveFlags.OperationModeZone2;
757
757
  break;
758
758
  };
759
759
  operationModeText = HeatPump.ZoneOperationMapEnumToString[deviceData.Device.OperationModeZone2];
760
760
  break;
761
761
  };
762
762
 
763
- await this.melCloudAtw.send(this.accountType, this.displayType, deviceData, effectiveFlags);
763
+ await this.melCloudAtw.send(this.accountType, this.displayType, deviceData, flag);
764
764
  if (this.logInfo) this.emit('info', `${zoneName}, Set operation mode: ${operationModeText}`);
765
765
  } catch (error) {
766
766
  if (this.logWarn) this.emit('warn', `${zoneName}, Set operation mode error: ${error}`);
@@ -788,27 +788,27 @@ class DeviceAtw extends EventEmitter {
788
788
  })
789
789
  .onSet(async (value) => {
790
790
  try {
791
- let effectiveFlags = null;
791
+ let flag = null;
792
792
  switch (i) {
793
793
  case caseHeatPump: //Heat Pump
794
794
  //deviceData.Device.SetTemperatureZone1 = value;
795
- //effectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetTemperatureZone1;
795
+ //flag = CONSTANTS.HeatPump.EffectiveFlags.SetTemperatureZone1;
796
796
  break;
797
797
  case caseZone1: //Zone 1
798
798
  deviceData.Device.SetTemperatureZone1 = value;
799
- effectiveFlags = HeatPump.EffectiveFlags.SetTemperatureZone1;
799
+ flag = HeatPump.EffectiveFlags.SetTemperatureZone1;
800
800
  break;
801
801
  case caseHotWater: //Hot Water
802
802
  deviceData.Device.SetTankWaterTemperature = value;
803
- effectiveFlags = HeatPump.EffectiveFlags.SetTankWaterTemperature;
803
+ flag = HeatPump.EffectiveFlags.SetTankWaterTemperature;
804
804
  break;
805
805
  case caseZone2: //Zone 2
806
806
  deviceData.Device.SetTemperatureZone2 = value;
807
- effectiveFlags = HeatPump.EffectiveFlags.SetTemperatureZone2;
807
+ flag = HeatPump.EffectiveFlags.SetTemperatureZone2;
808
808
  break;
809
809
  };
810
810
 
811
- if (i > 0) await this.melCloudAtw.send(this.accountType, this.displayType, deviceData, effectiveFlags);
811
+ if (i > 0) await this.melCloudAtw.send(this.accountType, this.displayType, deviceData, flag);
812
812
  if (this.logInfo && i !== 0) this.emit('info', `${zoneName}, Set temperature: ${value}${this.accessory.temperatureUnit}`);
813
813
  } catch (error) {
814
814
  if (this.logWarn) this.emit('warn', `${zoneName}, Set temperature error: ${error}`);
@@ -1320,130 +1320,130 @@ class DeviceAtw extends EventEmitter {
1320
1320
  .onSet(async (state) => {
1321
1321
  if (displayType > 0 && displayType < 3) {
1322
1322
  try {
1323
- let effectiveFlags = null;
1323
+ let flag = null;
1324
1324
  switch (mode) {
1325
1325
  case 0: //POWER ON,OFF
1326
1326
  deviceData.Device.Power = state;
1327
- effectiveFlags = HeatPump.EffectiveFlags.Power;
1327
+ flag = HeatPump.EffectiveFlags.Power;
1328
1328
  break;
1329
1329
  case 1: //HEAT PUMP HEAT
1330
1330
  button.previousValue = state ? deviceData.Device.UnitStatus : button.previousValue ?? deviceData.Device.UnitStatus;
1331
1331
  deviceData.Device.Power = true;
1332
1332
  deviceData.Device.UnitStatus = state ? 0 : button.previousValue;
1333
- effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationMode;
1333
+ flag = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationMode;
1334
1334
  break;
1335
1335
  case 2: //COOL
1336
1336
  button.previousValue = state ? deviceData.Device.UnitStatus : button.previousValue ?? deviceData.Device.UnitStatus;
1337
1337
  deviceData.Device.Power = true;
1338
1338
  deviceData.Device.UnitStatus = state ? 1 : button.previousValue;
1339
- effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationMode;
1339
+ flag = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationMode;
1340
1340
  break;
1341
1341
  case 3: //HOLIDAY
1342
1342
  if (this.accountType === 'melcloud') {
1343
1343
  deviceData.Device.HolidayMode = state;
1344
- effectiveFlags = HeatPump.EffectiveFlags.HolidayMode;
1344
+ flag = HeatPump.EffectiveFlags.HolidayMode;
1345
1345
  }
1346
1346
 
1347
1347
  if (this.accountType === 'melcloudhome') {
1348
1348
  deviceData.Device.HolidayMode.Enabled = state;
1349
- effectiveFlags = 'holidaymode';
1349
+ flag = 'holidaymode';
1350
1350
  }
1351
1351
  break;
1352
1352
  case 10: //ALL ZONES PHYSICAL LOCK CONTROL
1353
1353
  deviceData.Device.ProhibitZone1 = state;
1354
1354
  deviceData.Device.ProhibitHotWater = state;
1355
1355
  deviceData.Device.ProhibitZone2 = state;
1356
- effectiveFlags = HeatPump.EffectiveFlags.ProhibitHeatingZone1 + HeatPump.EffectiveFlags.ProhibitHotWater + HeatPump.EffectiveFlags.ProhibitHeatingZone2;
1356
+ flag = HeatPump.EffectiveFlags.ProhibitHeatingZone1 + HeatPump.EffectiveFlags.ProhibitHotWater + HeatPump.EffectiveFlags.ProhibitHeatingZone2;
1357
1357
  break;
1358
1358
  case 20: //ZONE 1 HEAT THERMOSTAT
1359
1359
  button.previousValue = state ? deviceData.Device.OperationModeZone1 : button.previousValue ?? deviceData.Device.OperationModeZone1;
1360
1360
  deviceData.Device.Power = true;
1361
1361
  deviceData.Device.OperationModeZone1 = state ? 0 : button.previousValue;
1362
- effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationModeZone1;
1362
+ flag = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationModeZone1;
1363
1363
  break;
1364
1364
  case 21: //HEAT FLOW
1365
1365
  button.previousValue = state ? deviceData.Device.OperationModeZone1 : button.previousValue ?? deviceData.Device.OperationModeZone1;
1366
1366
  deviceData.Device.Power = true;
1367
1367
  deviceData.Device.OperationModeZone1 = state ? 1 : button.previousValue;
1368
- effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationModeZone1;
1368
+ flag = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationModeZone1;
1369
1369
  break;
1370
1370
  case 22: //HEAT CURVE
1371
1371
  button.previousValue = state ? deviceData.Device.OperationModeZone1 : button.previousValue ?? deviceData.Device.OperationModeZone1;
1372
1372
  deviceData.Device.Power = true;
1373
1373
  deviceData.Device.OperationModeZone1 = state ? 2 : button.previousValue;
1374
- effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationModeZone1;
1374
+ flag = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationModeZone1;
1375
1375
  break;
1376
1376
  case 23: //COOL THERMOSTAT
1377
1377
  button.previousValue = state ? deviceData.Device.OperationModeZone1 : button.previousValue ?? deviceData.Device.OperationModeZone1;
1378
1378
  deviceData.Device.Power = true;
1379
1379
  deviceData.Device.OperationModeZone1 = state ? 3 : button.previousValue;
1380
- effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationModeZone1;
1380
+ flag = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationModeZone1;
1381
1381
  break;
1382
1382
  case 24: //COOL FLOW
1383
1383
  button.previousValue = state ? deviceData.Device.OperationModeZone1 : button.previousValue ?? deviceData.Device.OperationModeZone1;
1384
1384
  deviceData.Device.Power = true;
1385
1385
  deviceData.Device.OperationModeZone1 = state ? 4 : button.previousValue;
1386
- effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationModeZone1;
1386
+ flag = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationModeZone1;
1387
1387
  break;
1388
1388
  case 25: //FLOOR DRY UP
1389
1389
  button.previousValue = state ? deviceData.Device.OperationModeZone1 : button.previousValue ?? deviceData.Device.OperationModeZone1;
1390
1390
  deviceData.Device.Power = true;
1391
1391
  deviceData.Device.OperationModeZone1 = state ? 5 : button.previousValue;
1392
- effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationModeZone1;
1392
+ flag = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationModeZone1;
1393
1393
  break;
1394
1394
  case 30: //PHYSICAL LOCK CONTROL
1395
1395
  deviceData.Device.ProhibitZone1 = state;
1396
- effectiveFlags = HeatPump.EffectiveFlags.ProhibitHeatingZone1;
1396
+ flag = HeatPump.EffectiveFlags.ProhibitHeatingZone1;
1397
1397
  break;
1398
1398
  case 40: //HOT WATER NORMAL/FORCE HOT WATER
1399
1399
  deviceData.Device.Power = true;
1400
1400
  deviceData.Device.ForcedHotWaterMode = state;
1401
- effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.ForcedHotWaterMode;
1401
+ flag = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.ForcedHotWaterMode;
1402
1402
  break;
1403
1403
  case 41: //NORMAL/ECO
1404
1404
  deviceData.Device.Power = true;
1405
1405
  deviceData.Device.EcoHotWater = state;
1406
- effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.EcoHotWater;
1406
+ flag = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.EcoHotWater;
1407
1407
  break;
1408
1408
  case 50: //PHYSICAL LOCK CONTROL
1409
1409
  deviceData.Device.ProhibitHotWater = state;
1410
- effectiveFlags = HeatPump.EffectiveFlags.ProhibitHotWater;
1410
+ flag = HeatPump.EffectiveFlags.ProhibitHotWater;
1411
1411
  break;
1412
1412
  case 60: //ZONE 2 HEAT THERMOSTAT
1413
1413
  button.previousValue = state ? deviceData.Device.OperationModeZone2 : button.previousValue ?? deviceData.Device.OperationModeZone2;
1414
1414
  deviceData.Device.Power = true;
1415
1415
  deviceData.Device.OperationModeZone2 = state ? 0 : button.previousValue;
1416
- effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationModeZone2;
1416
+ flag = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationModeZone2;
1417
1417
  break;
1418
1418
  case 61: // HEAT FLOW
1419
1419
  button.previousValue = state ? deviceData.Device.OperationModeZone2 : button.previousValue ?? deviceData.Device.OperationModeZone2;
1420
1420
  deviceData.Device.Power = true;
1421
1421
  deviceData.Device.OperationModeZone2 = state ? 1 : button.previousValue;
1422
- effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationModeZone2;
1422
+ flag = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationModeZone2;
1423
1423
  break;
1424
1424
  case 62: //HEAT CURVE
1425
1425
  button.previousValue = state ? deviceData.Device.OperationModeZone2 : button.previousValue ?? deviceData.Device.OperationModeZone2;
1426
1426
  deviceData.Device.Power = true;
1427
1427
  deviceData.Device.OperationModeZone2 = state ? 2 : button.previousValue;
1428
- effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationModeZone2;
1428
+ flag = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationModeZone2;
1429
1429
  break;
1430
1430
  case 63: //COOL THERMOSTAT
1431
1431
  button.previousValue = state ? deviceData.Device.OperationModeZone2 : button.previousValue ?? deviceData.Device.OperationModeZone2;
1432
1432
  deviceData.Device.Power = true;
1433
1433
  deviceData.Device.OperationModeZone2 = state ? 3 : button.previousValue;
1434
- effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationModeZone2;
1434
+ flag = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationModeZone2;
1435
1435
  break;
1436
1436
  case 64: //COOL FLOW
1437
1437
  button.previousValue = state ? deviceData.Device.OperationModeZone2 : button.previousValue ?? deviceData.Device.OperationModeZone2;
1438
1438
  deviceData.Device.Power = true;
1439
1439
  deviceData.Device.OperationModeZone2 = state ? 4 : button.previousValue;
1440
- effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationModeZone2;
1440
+ flag = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationModeZone2;
1441
1441
  break;
1442
1442
  case 65: //FLOOR DRY UP
1443
1443
  button.previousValue = state ? deviceData.Device.OperationModeZone2 : button.previousValue ?? deviceData.Device.OperationModeZone2;
1444
1444
  deviceData.Device.Power = true;
1445
1445
  deviceData.Device.OperationModeZone2 = state ? 5 : button.previousValue;
1446
- effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationModeZone2;
1446
+ flag = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationModeZone2;
1447
1447
  break;
1448
1448
  case 70: //PHYSICAL LOCK CONTROL
1449
1449
  deviceData.Device.ProhibitZone2 = state;
@@ -1454,7 +1454,7 @@ class DeviceAtw extends EventEmitter {
1454
1454
  break;
1455
1455
  };
1456
1456
 
1457
- await this.melCloudAtw.send(this.accountType, this.displayType, deviceData, effectiveFlags);
1457
+ await this.melCloudAtw.send(this.accountType, this.displayType, deviceData, flag);
1458
1458
  if (this.logInfo) this.emit('info', `${state ? `Set: ${name}` : `Unset: ${name}, Set: ${button.previousValue}`}`);
1459
1459
  } catch (error) {
1460
1460
  if (this.logWarn) this.emit('warn', `Set button error: ${error}`);