homebridge-melcloud-control 4.1.3-beta.13 → 4.1.3-beta.14

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.1.3-beta.13",
4
+ "version": "4.1.3-beta.14",
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
@@ -647,6 +647,7 @@ class DeviceAta extends EventEmitter {
647
647
 
648
648
  //holiday mode
649
649
  if (this.accessory.holidayModeEnabled !== null) {
650
+ //control
650
651
  if (this.logDebug) this.emit('debug', `Prepare holiday mode control service`);
651
652
  this.holidayModeControlService = new Service.Switch(`${serviceName} Holiday Mode`, `Holiday Mode Control ${deviceId}`);
652
653
  this.holidayModeControlService.addOptionalCharacteristic(Characteristic.ConfiguredName);
@@ -667,6 +668,18 @@ class DeviceAta extends EventEmitter {
667
668
  });
668
669
  accessory.addService(this.holidayModeControlService);
669
670
 
671
+ if (this.logDebug) this.emit('debug', `Prepare holiday mode control sensor service`);
672
+ this.holidayModeControlSensorService = new Service.ContactSensor(`${serviceName} Holiday Mode Control`, `Holiday Mode Control Sensor ${deviceId}`);
673
+ this.holidayModeControlSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
674
+ this.holidayModeControlSensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Holiday Mode Control`);
675
+ this.holidayModeControlSensorService.getCharacteristic(Characteristic.ContactSensorState)
676
+ .onGet(async () => {
677
+ const state = this.accessory.holidayModeEnabled;
678
+ return state;
679
+ })
680
+ accessory.addService(this.holidayModeControlSensorService);
681
+
682
+ //sensors
670
683
  if (this.logDebug) this.emit('debug', `Prepare holiday mode sensor service`);
671
684
  this.holidayModeSensorService = new Service.ContactSensor(`${serviceName} Holiday Mode`, `Holiday Mode Sensor ${deviceId}`);
672
685
  this.holidayModeSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
@@ -1354,6 +1367,7 @@ class DeviceAta extends EventEmitter {
1354
1367
  this.frostProtectionSensorService?.updateCharacteristic(Characteristic.ContactSensorState, frostProtectionActive);
1355
1368
  this.overheatProtectionSensorService?.updateCharacteristic(Characteristic.ContactSensorState, overheatProtectionActive);
1356
1369
  this.holidayModeControlService?.updateCharacteristic(Characteristic.On, holidayModeEnabled);
1370
+ this.holidayModeControlSensorService?.updateCharacteristic(Characteristic.ContactSensorState, holidayModeEnabled);
1357
1371
  this.holidayModeSensorService?.updateCharacteristic(Characteristic.ContactSensorState, holidayModeActive);
1358
1372
  this.errorService?.updateCharacteristic(Characteristic.ContactSensorState, isInError);
1359
1373
 
package/src/deviceatw.js CHANGED
@@ -1049,6 +1049,7 @@ class DeviceAtw extends EventEmitter {
1049
1049
 
1050
1050
  //holiday mode
1051
1051
  if (this.accessory.holidayModeEnabled !== null) {
1052
+ //control
1052
1053
  if (this.logDebug) this.emit('debug', `Prepare holiday mode control service`);
1053
1054
  const serviceName = `${deviceTypeText} ${accessoryName}`;
1054
1055
  this.holidayModeControlService = new Service.Switch(`${serviceName} Holiday Mode`, `Holiday Mode Control ${deviceId}`);
@@ -1070,6 +1071,18 @@ class DeviceAtw extends EventEmitter {
1070
1071
  });
1071
1072
  accessory.addService(this.holidayModeControlService);
1072
1073
 
1074
+ if (this.logDebug) this.emit('debug', `Prepare holiday mode control sensor service`);
1075
+ this.holidayModeControlSensorService = new Service.ContactSensor(`${serviceName} Holiday Mode Control`, `Holiday Mode Control Sensor ${deviceId}`);
1076
+ this.holidayModeControlSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
1077
+ this.holidayModeControlSensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Holiday Mode Control`);
1078
+ this.holidayModeControlSensorService.getCharacteristic(Characteristic.ContactSensorState)
1079
+ .onGet(async () => {
1080
+ const state = this.accessory.holidayModeEnabled;
1081
+ return state;
1082
+ })
1083
+ accessory.addService(this.holidayModeControlSensorService);
1084
+
1085
+ //sensor
1073
1086
  if (this.logDebug) this.emit('debug', `Prepare holiday mode sensor service`);
1074
1087
  this.holidayModeSensorService = new Service.ContactSensor(`${serviceName} Holiday Mode`, `Holiday Mode Sensor ${deviceId}`);
1075
1088
  this.holidayModeSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
@@ -1934,6 +1947,7 @@ class DeviceAtw extends EventEmitter {
1934
1947
 
1935
1948
  //update sensors state
1936
1949
  this.holidayModeControlService?.updateCharacteristic(Characteristic.On, holidayModeEnabled);
1950
+ this.holidayModeControlSensorService?.updateCharacteristic(Characteristic.ContactSensorState, holidayModeEnabled);
1937
1951
  this.holidayModeSensorService?.updateCharacteristic(Characteristic.ContactSensorState, holidayModeActive);
1938
1952
  this.errorService?.updateCharacteristic(Characteristic.ContactSensorState, isInError);
1939
1953
 
package/src/deviceerv.js CHANGED
@@ -668,6 +668,7 @@ class DeviceErv extends EventEmitter {
668
668
 
669
669
  //holiday mode
670
670
  if (this.accessory.holidayModeEnabled !== null) {
671
+ //control
671
672
  if (this.logDebug) this.emit('debug', `Prepare holiday mode control service`);
672
673
  this.holidayModeControlService = new Service.Switch(`${serviceName} Holiday Mode`, `Holiday Mode Control ${deviceId}`);
673
674
  this.holidayModeControlService.addOptionalCharacteristic(Characteristic.ConfiguredName);
@@ -688,6 +689,18 @@ class DeviceErv extends EventEmitter {
688
689
  });
689
690
  accessory.addService(this.holidayModeControlService);
690
691
 
692
+ if (this.logDebug) this.emit('debug', `Prepare holiday mode control sensor service`);
693
+ this.holidayModeControlSensorService = new Service.ContactSensor(`${serviceName} Holiday Mode Control`, `Holiday Mode Control Sensor ${deviceId}`);
694
+ this.holidayModeControlSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
695
+ this.holidayModeControlSensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Holiday Mode Control`);
696
+ this.holidayModeControlSensorService.getCharacteristic(Characteristic.ContactSensorState)
697
+ .onGet(async () => {
698
+ const state = this.accessory.holidayModeEnabled;
699
+ return state;
700
+ })
701
+ accessory.addService(this.holidayModeControlSensorService);
702
+
703
+ //sensor
691
704
  if (this.logDebug) this.emit('debug', `Prepare holiday mode sensor service`);
692
705
  this.holidayModeSensorService = new Service.ContactSensor(`${serviceName} Holiday Mode`, `Holiday Mode Sensor ${deviceId}`);
693
706
  this.holidayModeSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
@@ -1226,6 +1239,7 @@ class DeviceErv extends EventEmitter {
1226
1239
 
1227
1240
  //error sensor
1228
1241
  this.holidayModeControlService?.updateCharacteristic(Characteristic.On, holidayModeEnabled);
1242
+ this.holidayModeControlSensorService?.updateCharacteristic(Characteristic.ContactSensorState, holidayModeEnabled);
1229
1243
  this.holidayModeSensorService?.updateCharacteristic(Characteristic.ContactSensorState, holidayModeActive);
1230
1244
  this.errorService?.updateCharacteristic(Characteristic.ContactSensorState, isInError);
1231
1245