homebridge-melcloud-control 4.2.6-beta.7 → 4.2.6-beta.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "4.2.6-beta.7",
4
+ "version": "4.2.6-beta.9",
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
@@ -345,9 +345,9 @@ class DeviceAta extends EventEmitter {
345
345
  switch (this.displayType) {
346
346
  case 1: //Heater Cooler
347
347
  if (this.logDebug) this.emit('debug', `Prepare heater/cooler service`);
348
- const melCloudService = accessory.addService(Service.HeaterCooler, serviceName, `HeaterCooler ${deviceId}`);
349
- melCloudService.setPrimaryService(true);
350
- melCloudService.getCharacteristic(Characteristic.Active)
348
+ this.melCloudService = new Service.HeaterCooler(serviceName, `HeaterCooler ${deviceId}`);
349
+ this.melCloudService.setPrimaryService(true);
350
+ this.melCloudService.getCharacteristic(Characteristic.Active)
351
351
  .onGet(async () => {
352
352
  const state = this.accessory.power;
353
353
  return state;
@@ -362,12 +362,12 @@ class DeviceAta extends EventEmitter {
362
362
  if (this.logWarn) this.emit('warn', `Set power error: ${error}`);
363
363
  };
364
364
  });
365
- melCloudService.getCharacteristic(Characteristic.CurrentHeaterCoolerState)
365
+ this.melCloudService.getCharacteristic(Characteristic.CurrentHeaterCoolerState)
366
366
  .onGet(async () => {
367
367
  const value = this.accessory.currentOperationMode;
368
368
  return value;
369
369
  });
370
- melCloudService.getCharacteristic(Characteristic.TargetHeaterCoolerState)
370
+ this.melCloudService.getCharacteristic(Characteristic.TargetHeaterCoolerState)
371
371
  .setProps({
372
372
  minValue: this.accessory.operationModeSetPropsMinValue,
373
373
  maxValue: this.accessory.operationModeSetPropsMaxValue,
@@ -400,13 +400,13 @@ class DeviceAta extends EventEmitter {
400
400
  if (this.logWarn) this.emit('warn', `Set operation mode error: ${error}`);
401
401
  };
402
402
  });
403
- melCloudService.getCharacteristic(Characteristic.CurrentTemperature)
403
+ this.melCloudService.getCharacteristic(Characteristic.CurrentTemperature)
404
404
  .onGet(async () => {
405
405
  const value = this.accessory.roomTemperature;
406
406
  return value;
407
407
  });
408
408
  if (supportsFanSpeed) {
409
- melCloudService.getCharacteristic(Characteristic.RotationSpeed)
409
+ this.melCloudService.getCharacteristic(Characteristic.RotationSpeed)
410
410
  .setProps({
411
411
  minValue: 0,
412
412
  maxValue: this.accessory.fanSpeedSetPropsMaxValue,
@@ -443,7 +443,7 @@ class DeviceAta extends EventEmitter {
443
443
  });
444
444
  };
445
445
  if (supportsSwingFunction) {
446
- melCloudService.getCharacteristic(Characteristic.SwingMode)
446
+ this.melCloudService.getCharacteristic(Characteristic.SwingMode)
447
447
  .onGet(async () => {
448
448
  //Vane Horizontal: Auto, 1, 2, 3, 4, 5, 6, 7 = Sp;it, 12 = Swing //Vertical: Auto, 1, 2, 3, 4, 5, 7 = Swing
449
449
  const value = this.accessory.currentSwingMode;
@@ -460,7 +460,7 @@ class DeviceAta extends EventEmitter {
460
460
  };
461
461
  });
462
462
  };
463
- melCloudService.getCharacteristic(Characteristic.CoolingThresholdTemperature)
463
+ this.melCloudService.getCharacteristic(Characteristic.CoolingThresholdTemperature)
464
464
  .setProps({
465
465
  minValue: this.accessory.minTempCoolDryAuto,
466
466
  maxValue: this.accessory.maxTempCoolDryAuto,
@@ -481,7 +481,7 @@ class DeviceAta extends EventEmitter {
481
481
  };
482
482
  });
483
483
  if (supportsHeat) {
484
- melCloudService.getCharacteristic(Characteristic.HeatingThresholdTemperature)
484
+ this.melCloudService.getCharacteristic(Characteristic.HeatingThresholdTemperature)
485
485
  .setProps({
486
486
  minValue: this.accessory.minTempHeat,
487
487
  maxValue: this.accessory.maxTempHeat,
@@ -502,7 +502,7 @@ class DeviceAta extends EventEmitter {
502
502
  };
503
503
  });
504
504
  };
505
- melCloudService.getCharacteristic(Characteristic.LockPhysicalControls)
505
+ this.melCloudService.getCharacteristic(Characteristic.LockPhysicalControls)
506
506
  .onGet(async () => {
507
507
  const value = this.accessory.lockPhysicalControl;
508
508
  return value;
@@ -521,7 +521,7 @@ class DeviceAta extends EventEmitter {
521
521
  if (this.logWarn) this.emit('warn', `Set lock physical controls error: ${error}`);
522
522
  };
523
523
  });
524
- melCloudService.getCharacteristic(Characteristic.TemperatureDisplayUnits)
524
+ this.melCloudService.getCharacteristic(Characteristic.TemperatureDisplayUnits)
525
525
  .onGet(async () => {
526
526
  const value = this.accessory.useFahrenheit;
527
527
  return value;
@@ -538,18 +538,18 @@ class DeviceAta extends EventEmitter {
538
538
  if (this.logWarn) this.emit('warn', `Set temperature display unit error: ${error}`);
539
539
  };
540
540
  });
541
- this.melCloudService = melCloudService;
541
+ accessory.addService(this.melCloudService);
542
542
  break;
543
543
  case 2: //Thermostat
544
544
  if (this.logDebug) this.emit('debug', `Prepare thermostat service`);
545
- const melCloudServiceT = accessory.addService(Service.Thermostat, serviceName, `Thermostat ${deviceId}`);
546
- melCloudServiceT.setPrimaryService(true);
547
- melCloudServiceT.getCharacteristic(Characteristic.CurrentHeatingCoolingState)
545
+ this.melCloudService = new Service.Thermostat(serviceName, `Thermostat ${deviceId}`);
546
+ this.melCloudService.setPrimaryService(true);
547
+ this.melCloudService.getCharacteristic(Characteristic.CurrentHeatingCoolingState)
548
548
  .onGet(async () => {
549
549
  const value = this.accessory.currentOperationMode;
550
550
  return value;
551
551
  });
552
- melCloudServiceT.getCharacteristic(Characteristic.TargetHeatingCoolingState)
552
+ this.melCloudService.getCharacteristic(Characteristic.TargetHeatingCoolingState)
553
553
  .setProps({
554
554
  minValue: this.accessory.operationModeSetPropsMinValue,
555
555
  maxValue: this.accessory.operationModeSetPropsMaxValue,
@@ -592,12 +592,12 @@ class DeviceAta extends EventEmitter {
592
592
  if (this.logWarn) this.emit('warn', `Set operation mode error: ${error}`);
593
593
  };
594
594
  });
595
- melCloudServiceT.getCharacteristic(Characteristic.CurrentTemperature)
595
+ this.melCloudService.getCharacteristic(Characteristic.CurrentTemperature)
596
596
  .onGet(async () => {
597
597
  const value = this.accessory.roomTemperature;
598
598
  return value;
599
599
  });
600
- melCloudServiceT.getCharacteristic(Characteristic.TargetTemperature)
600
+ this.melCloudService.getCharacteristic(Characteristic.TargetTemperature)
601
601
  .setProps({
602
602
  minValue: this.accessory.minTempHeat,
603
603
  maxValue: this.accessory.maxTempHeat,
@@ -616,7 +616,7 @@ class DeviceAta extends EventEmitter {
616
616
  if (this.logWarn) this.emit('warn', `Set temperature error: ${error}`);
617
617
  };
618
618
  });
619
- melCloudServiceT.getCharacteristic(Characteristic.TemperatureDisplayUnits)
619
+ this.melCloudService.getCharacteristic(Characteristic.TemperatureDisplayUnits)
620
620
  .onGet(async () => {
621
621
  const value = this.accessory.useFahrenheit;
622
622
  return value;
@@ -633,7 +633,7 @@ class DeviceAta extends EventEmitter {
633
633
  if (this.logWarn) this.emit('warn', `Set temperature display unit error: ${error}`);
634
634
  };
635
635
  });
636
- this.melCloudService = melCloudServiceT;
636
+ accessory.addService(this.melCloudService);
637
637
  break;
638
638
  };
639
639
 
@@ -1867,7 +1867,6 @@ class DeviceAta extends EventEmitter {
1867
1867
 
1868
1868
  //check state
1869
1869
  await this.melCloudAta.checkState();
1870
- await new Promise(r => setTimeout(r, 1000));
1871
1870
 
1872
1871
  //prepare accessory
1873
1872
  const accessory = await this.prepareAccessory();
package/src/deviceatw.js CHANGED
@@ -351,7 +351,7 @@ class DeviceAtw extends EventEmitter {
351
351
  switch (this.displayType) {
352
352
  case 1: //Heater Cooler
353
353
  if (this.logDebug) this.emit('debug', `Prepare heather/cooler ${zoneName} service`);
354
- const melCloudService = accessory.addService(Service.HeaterCooler, serviceName, `HeaterCooler ${deviceId} ${i}`);
354
+ const melCloudService = new Service.HeaterCooler(serviceName, `HeaterCooler ${deviceId} ${i}`);
355
355
  melCloudService.setPrimaryService(true);
356
356
  melCloudService.getCharacteristic(Characteristic.Active)
357
357
  .onGet(async () => {
@@ -663,7 +663,7 @@ class DeviceAtw extends EventEmitter {
663
663
  break;
664
664
  case 2: //Thermostat
665
665
  if (this.logDebug) this.emit('debug', `Prepare thermostat ${zoneName} service`);
666
- const melCloudServiceT = accessory.addService(Service.Thermostat, serviceName, `Thermostat ${deviceId} ${i}`);
666
+ const melCloudServiceT = new Service.Thermostat(serviceName, `Thermostat ${deviceId} ${i}`);
667
667
  melCloudServiceT.setPrimaryService(true);
668
668
  melCloudServiceT.getCharacteristic(Characteristic.CurrentHeatingCoolingState)
669
669
  .onGet(async () => {
package/src/deviceerv.js CHANGED
@@ -316,9 +316,9 @@ class DeviceErv extends EventEmitter {
316
316
  switch (this.displayType) {
317
317
  case 1: //Heater Cooler
318
318
  if (this.logDebug) this.emit('debug', `Prepare heather/cooler service`);
319
- const melCloudService = accessory.addService(HeaterCooler, serviceName, `HeaterCooler ${deviceId}`);
320
- melCloudService.setPrimaryService(true);
321
- melCloudService.getCharacteristic(Characteristic.Active)
319
+ this.melCloudService = new Service.HeaterCooler(serviceName, `HeaterCooler ${deviceId}`);
320
+ this.melCloudService.setPrimaryService(true);
321
+ this.melCloudService.getCharacteristic(Characteristic.Active)
322
322
  .onGet(async () => {
323
323
  const state = this.accessory.power;
324
324
  return state;
@@ -332,12 +332,12 @@ class DeviceErv extends EventEmitter {
332
332
  if (this.logWarn) this.emit('warn', `Set power error: ${error}`);
333
333
  };
334
334
  });
335
- melCloudService.getCharacteristic(Characteristic.CurrentHeaterCoolerState)
335
+ this.melCloudService.getCharacteristic(Characteristic.CurrentHeaterCoolerState)
336
336
  .onGet(async () => {
337
337
  const value = this.accessory.currentOperationMode;
338
338
  return value;
339
339
  });
340
- melCloudService.getCharacteristic(Characteristic.TargetHeaterCoolerState)
340
+ this.melCloudService.getCharacteristic(Characteristic.TargetHeaterCoolerState)
341
341
  .setProps({
342
342
  minValue: this.accessory.operationModeSetPropsMinValue,
343
343
  maxValue: this.accessory.operationModeSetPropsMaxValue,
@@ -367,13 +367,13 @@ class DeviceErv extends EventEmitter {
367
367
  if (this.logWarn) this.emit('warn', `Set operation mode error: ${error}`);
368
368
  };
369
369
  });
370
- melCloudService.getCharacteristic(Characteristic.CurrentTemperature)
370
+ this.melCloudService.getCharacteristic(Characteristic.CurrentTemperature)
371
371
  .onGet(async () => {
372
372
  const value = this.accessory.roomTemperature;
373
373
  return value;
374
374
  });
375
375
  if (supportsFanSpeed) {
376
- melCloudService.getCharacteristic(Characteristic.RotationSpeed)
376
+ this.melCloudService.getCharacteristic(Characteristic.RotationSpeed)
377
377
  .setProps({
378
378
  minValue: 0,
379
379
  maxValue: this.accessory.fanSpeedSetPropsMaxValue,
@@ -410,7 +410,7 @@ class DeviceErv extends EventEmitter {
410
410
  }
411
411
  //device can cool
412
412
  if (supportsAutoVentilationMode && supportsCoolOperationMode) {
413
- melCloudService.getCharacteristic(Characteristic.CoolingThresholdTemperature)
413
+ this.melCloudService.getCharacteristic(Characteristic.CoolingThresholdTemperature)
414
414
  .setProps({
415
415
  minValue: this.accessory.minTempCoolDry,
416
416
  maxValue: this.accessory.maxTempCoolDry,
@@ -432,7 +432,7 @@ class DeviceErv extends EventEmitter {
432
432
  };
433
433
  //device can heat
434
434
  if (supportsAutoVentilationMode && supportsHeatOperationMode) {
435
- melCloudService.getCharacteristic(Characteristic.HeatingThresholdTemperature)
435
+ this.melCloudService.getCharacteristic(Characteristic.HeatingThresholdTemperature)
436
436
  .setProps({
437
437
  minValue: this.accessory.minTempHeat,
438
438
  maxValue: this.accessory.maxTempHeat,
@@ -452,7 +452,7 @@ class DeviceErv extends EventEmitter {
452
452
  };
453
453
  });
454
454
  };
455
- melCloudService.getCharacteristic(Characteristic.TemperatureDisplayUnits)
455
+ this.melCloudService.getCharacteristic(Characteristic.TemperatureDisplayUnits)
456
456
  .onGet(async () => {
457
457
  const value = this.accessory.useFahrenheit;
458
458
  return value;
@@ -469,18 +469,18 @@ class DeviceErv extends EventEmitter {
469
469
  if (this.logWarn) this.emit('warn', `Set temperature display unit error: ${error}`);
470
470
  };
471
471
  });
472
- this.melCloudService = melCloudService;
472
+ accessory.addService(this.melCloudService);
473
473
  break;
474
474
  case 2: //Thermostat
475
475
  if (this.logDebug) this.emit('debug', `Prepare thermostat service`);
476
- const melCloudServiceT = accessory.addService(Thermostat, serviceName, `Thermostat ${deviceId}`);
477
- melCloudServiceT.setPrimaryService(true);
478
- melCloudServiceT.getCharacteristic(Characteristic.CurrentHeatingCoolingState)
476
+ this.melCloudService = new Service.Thermostat(serviceName, `Thermostat ${deviceId}`);
477
+ this.melCloudService.setPrimaryService(true);
478
+ this.melCloudService.getCharacteristic(Characteristic.CurrentHeatingCoolingState)
479
479
  .onGet(async () => {
480
480
  const value = this.accessory.currentOperationMode;
481
481
  return value;
482
482
  });
483
- melCloudServiceT.getCharacteristic(Characteristic.TargetHeatingCoolingState)
483
+ this.melCloudService.getCharacteristic(Characteristic.TargetHeatingCoolingState)
484
484
  .setProps({
485
485
  minValue: this.accessory.operationModeSetPropsMinValue,
486
486
  maxValue: this.accessory.operationModeSetPropsMaxValue,
@@ -521,12 +521,12 @@ class DeviceErv extends EventEmitter {
521
521
  if (this.logWarn) this.emit('warn', `Set operation mode error: ${error}`);
522
522
  };
523
523
  });
524
- melCloudServiceT.getCharacteristic(Characteristic.CurrentTemperature)
524
+ this.melCloudService.getCharacteristic(Characteristic.CurrentTemperature)
525
525
  .onGet(async () => {
526
526
  const value = this.accessory.roomTemperature;
527
527
  return value;
528
528
  });
529
- melCloudServiceT.getCharacteristic(Characteristic.TargetTemperature)
529
+ this.melCloudService.getCharacteristic(Characteristic.TargetTemperature)
530
530
  .setProps({
531
531
  minValue: this.accessory.minTempHeat,
532
532
  maxValue: this.accessory.maxTempHeat,
@@ -545,7 +545,7 @@ class DeviceErv extends EventEmitter {
545
545
  if (this.logWarn) this.emit('warn', `Set temperature error: ${error}`);
546
546
  };
547
547
  });
548
- melCloudServiceT.getCharacteristic(Characteristic.TemperatureDisplayUnits)
548
+ this.melCloudService.getCharacteristic(Characteristic.TemperatureDisplayUnits)
549
549
  .onGet(async () => {
550
550
  const value = this.accessory.useFahrenheit;
551
551
  return value;
@@ -562,7 +562,7 @@ class DeviceErv extends EventEmitter {
562
562
  if (this.logWarn) this.emit('warn', `Set temperature display unit error: ${error}`);
563
563
  };
564
564
  });
565
- this.melCloudService = melCloudServiceT;
565
+ accessory.addService(this.melCloudService);
566
566
  break;
567
567
  };
568
568