homebridge-melcloud-control 4.2.0-beta.0 → 4.2.0-beta.1

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.0-beta.0",
4
+ "version": "4.2.0-beta.1",
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
@@ -670,7 +670,7 @@ class DeviceAta extends EventEmitter {
670
670
  if (this.logDebug) this.emit('debug', `Prepare frost protection service`);
671
671
  this.frostProtectionSensorService = new Service.ContactSensor(`${serviceName} Frost Protection`, `frostProtectionSensorService${deviceId}`);
672
672
  this.frostProtectionSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
673
- this.frostProtectionSensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Frost Protection State`);
673
+ this.frostProtectionSensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Frost Protection`);
674
674
  this.frostProtectionSensorService.getCharacteristic(Characteristic.ContactSensorState)
675
675
  .onGet(async () => {
676
676
  const state = this.accessory.frostProtectionActive;
@@ -716,7 +716,7 @@ class DeviceAta extends EventEmitter {
716
716
  if (this.logDebug) this.emit('debug', `Prepare overheat protection sensor service`);
717
717
  this.overheatProtectionSensorService = new Service.ContactSensor(`${serviceName} Overheat Protection`, `overheatProtectionSensorService${deviceId}`);
718
718
  this.overheatProtectionSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
719
- this.overheatProtectionSensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Overheat Protection State`);
719
+ this.overheatProtectionSensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Overheat Protection`);
720
720
  this.overheatProtectionSensorService.getCharacteristic(Characteristic.ContactSensorState)
721
721
  .onGet(async () => {
722
722
  const state = this.accessory.overheatProtectionActive;
@@ -763,7 +763,7 @@ class DeviceAta extends EventEmitter {
763
763
  if (this.logDebug) this.emit('debug', `Prepare holiday mode sensor service`);
764
764
  this.holidayModeSensorService = new Service.ContactSensor(`${serviceName} Holiday Mode`, `holidayModeSensorService${deviceId}`);
765
765
  this.holidayModeSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
766
- this.holidayModeSensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Holiday Mode State`);
766
+ this.holidayModeSensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Holiday Mode`);
767
767
  this.holidayModeSensorService.getCharacteristic(Characteristic.ContactSensorState)
768
768
  .onGet(async () => {
769
769
  const state = this.accessory.holidayModeActive;
@@ -785,12 +785,12 @@ class DeviceAta extends EventEmitter {
785
785
  //get preset name prefix
786
786
  const namePrefix = preset.namePrefix;
787
787
 
788
- const serviceName = namePrefix ? `${accessoryName} ${name}` : name;
788
+ const serviceName1 = namePrefix ? `${accessoryName} ${name}` : name;
789
789
  const serviceType = preset.serviceType;
790
790
  const characteristicType = preset.characteristicType;
791
- const presetService = new serviceType(serviceName, `Preset ${deviceId} ${i}`);
791
+ const presetService = new serviceType(serviceName1, `Preset ${deviceId} ${i}`);
792
792
  presetService.addOptionalCharacteristic(Characteristic.ConfiguredName);
793
- presetService.setCharacteristic(Characteristic.ConfiguredName, serviceName);
793
+ presetService.setCharacteristic(Characteristic.ConfiguredName, serviceName1);
794
794
  presetService.getCharacteristic(characteristicType)
795
795
  .onGet(async () => {
796
796
  const state = preset.state;
@@ -843,10 +843,9 @@ class DeviceAta extends EventEmitter {
843
843
  //control
844
844
  if (i === 0) {
845
845
  if (this.logDebug) this.emit('debug', `Prepare schedule control service`);
846
- const serviceNameSchedule = namePrefix ? `${accessoryName} Schedule Control` : `Schedule Control`;
847
- this.schedulesControlService = new Service.Switch(serviceNameSchedule, `schedulesControlService${deviceId} ${i}`);
846
+ this.schedulesControlService = new Service.Switch(`${serviceName} Schedule`, `schedulesControlService${deviceId} ${i}`);
848
847
  this.schedulesControlService.addOptionalCharacteristic(Characteristic.ConfiguredName);
849
- this.schedulesControlService.setCharacteristic(Characteristic.ConfiguredName, serviceNameSchedule);
848
+ this.schedulesControlService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Schedule`);
850
849
  this.schedulesControlService.getCharacteristic(Characteristic.On)
851
850
  .onGet(async () => {
852
851
  const state = this.accessory.scheduleEnabled;
@@ -864,9 +863,9 @@ class DeviceAta extends EventEmitter {
864
863
  accessory.addService(this.schedulesControlService);
865
864
 
866
865
  if (this.logDebug) this.emit('debug', `Prepare schedule control sensor service`);
867
- this.schedulesControlSensorService = new Service.ContactSensor(serviceNameSchedule, `schedulesControlSensorService${deviceId}`);
866
+ this.schedulesControlSensorService = new Service.ContactSensor(`${serviceName} Schedule Control`, `schedulesControlSensorService${deviceId}`);
868
867
  this.schedulesControlSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
869
- this.schedulesControlSensorService.setCharacteristic(Characteristic.ConfiguredName, serviceNameSchedule);
868
+ this.schedulesControlSensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Schedule Control`);
870
869
  this.schedulesControlSensorService.getCharacteristic(Characteristic.ContactSensorState)
871
870
  .onGet(async () => {
872
871
  const state = this.accessory.scheduleEnabled;
@@ -876,12 +875,12 @@ class DeviceAta extends EventEmitter {
876
875
  }
877
876
 
878
877
  //sensors
879
- const serviceName = namePrefix ? `${accessoryName} ${name}` : name;
878
+ const serviceName1 = namePrefix ? `${accessoryName} ${name}` : name;
880
879
  const serviceType = schedule.serviceType;
881
880
  const characteristicType = schedule.characteristicType;
882
- const scheduleService = new serviceType(serviceName, `scheduleService${deviceId} ${i}`);
881
+ const scheduleService = new serviceType(serviceName1, `scheduleService${deviceId} ${i}`);
883
882
  scheduleService.addOptionalCharacteristic(Characteristic.ConfiguredName);
884
- scheduleService.setCharacteristic(Characteristic.ConfiguredName, serviceName);
883
+ scheduleService.setCharacteristic(Characteristic.ConfiguredName, serviceName1);
885
884
  scheduleService.getCharacteristic(characteristicType)
886
885
  .onGet(async () => {
887
886
  const state = schedule.state;
package/src/deviceatw.js CHANGED
@@ -302,6 +302,7 @@ class DeviceAtw extends EventEmitter {
302
302
  .setCharacteristic(Characteristic.ConfiguredName, accessoryName);
303
303
 
304
304
  //services
305
+ const serviceName = `${deviceTypeText} ${accessoryName}`;
305
306
  if (zonesCount > 0) {
306
307
  this.melCloudServices = [];
307
308
  this.accessory.zones.forEach((zone, i) => {
@@ -1051,7 +1052,6 @@ class DeviceAtw extends EventEmitter {
1051
1052
  //error sensor
1052
1053
  if (this.errorSensor && this.accessory.isInError !== null) {
1053
1054
  if (this.logDebug) this.emit('debug', `Prepare error service`);
1054
- const serviceName = `${deviceTypeText} ${accessoryName}`;
1055
1055
  this.errorService = new Service.ContactSensor(`${serviceName} Error`, `Error Sensor ${deviceId}`);
1056
1056
  this.errorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
1057
1057
  this.errorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Error`);
@@ -1194,10 +1194,9 @@ class DeviceAtw extends EventEmitter {
1194
1194
  //control
1195
1195
  if (i === 0) {
1196
1196
  if (this.logDebug) this.emit('debug', `Prepare schedule control service`);
1197
- const serviceNameSchedule = namePrefix ? `${accessoryName} Schedule Control` : `Schedule Control`;
1198
- this.schedulesControlService = new Service.Switch(serviceNameSchedule, `Schedule Control ${deviceId} ${i}`);
1197
+ this.schedulesControlService = new Service.Switch(`${serviceName} Schedule`, `schedulesControlService${deviceId} ${i}`);
1199
1198
  this.schedulesControlService.addOptionalCharacteristic(Characteristic.ConfiguredName);
1200
- this.schedulesControlService.setCharacteristic(Characteristic.ConfiguredName, serviceNameSchedule);
1199
+ this.schedulesControlService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Schedules`);
1201
1200
  this.schedulesControlService.getCharacteristic(Characteristic.On)
1202
1201
  .onGet(async () => {
1203
1202
  const state = this.accessory.scheduleEnabled;
@@ -1215,24 +1214,24 @@ class DeviceAtw extends EventEmitter {
1215
1214
  accessory.addService(this.schedulesControlService);
1216
1215
 
1217
1216
  if (this.logDebug) this.emit('debug', `Prepare schedule control sensor service`);
1218
- this.scheduleSensorService = new Service.ContactSensor(serviceNameSchedule, `Schedule Control Sensor ${deviceId}`);
1219
- this.scheduleSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
1220
- this.scheduleSensorService.setCharacteristic(Characteristic.ConfiguredName, serviceNameSchedule);
1221
- this.scheduleSensorService.getCharacteristic(Characteristic.ContactSensorState)
1217
+ this.schedulesControlSensorService = new Service.ContactSensor(`${serviceName} Schedule Control`, `schedulesControlSensorService${deviceId}`);
1218
+ this.schedulesControlSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
1219
+ this.schedulesControlSensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Schedule Control`);
1220
+ this.schedulesControlSensorService.getCharacteristic(Characteristic.ContactSensorState)
1222
1221
  .onGet(async () => {
1223
1222
  const state = this.accessory.scheduleEnabled;
1224
1223
  return state;
1225
1224
  })
1226
- accessory.addService(this.scheduleSensorService);
1225
+ accessory.addService(this.schedulesControlSensorService);
1227
1226
  }
1228
1227
 
1229
1228
  //sensors
1230
- const serviceName = namePrefix ? `${accessoryName} ${name}` : name;
1229
+ const serviceName1 = namePrefix ? `${accessoryName} ${name}` : name;
1231
1230
  const serviceType = schedule.serviceType;
1232
1231
  const characteristicType = schedule.characteristicType;
1233
- const scheduleService = new serviceType(serviceName, `Schedule Sensor ${deviceId} ${i}`);
1232
+ const scheduleService = new serviceType(serviceName, `scheduleService${deviceId} ${i}`);
1234
1233
  scheduleService.addOptionalCharacteristic(Characteristic.ConfiguredName);
1235
- scheduleService.setCharacteristic(Characteristic.ConfiguredName, serviceName);
1234
+ scheduleService.setCharacteristic(Characteristic.ConfiguredName, serviceName1);
1236
1235
  scheduleService.getCharacteristic(characteristicType)
1237
1236
  .onGet(async () => {
1238
1237
  const state = schedule.state;
@@ -1260,12 +1259,12 @@ class DeviceAtw extends EventEmitter {
1260
1259
  //get button name prefix
1261
1260
  const namePrefix = button.namePrefix;
1262
1261
 
1263
- const serviceName = namePrefix ? `${accessoryName} ${name}` : name;
1262
+ const serviceName1 = namePrefix ? `${accessoryName} ${name}` : name;
1264
1263
  const serviceType = button.serviceType;
1265
1264
  const characteristicType = button.characteristicType;
1266
1265
  const buttonService = new serviceType(serviceName, `Button ${deviceId} ${i}`);
1267
1266
  buttonService.addOptionalCharacteristic(Characteristic.ConfiguredName);
1268
- buttonService.setCharacteristic(Characteristic.ConfiguredName, serviceName);
1267
+ buttonService.setCharacteristic(Characteristic.ConfiguredName, serviceName1);
1269
1268
  buttonService.getCharacteristic(characteristicType)
1270
1269
  .onGet(async () => {
1271
1270
  const state = button.state;
package/src/deviceerv.js CHANGED
@@ -741,12 +741,12 @@ class DeviceErv extends EventEmitter {
741
741
  //get preset name prefix
742
742
  const namePrefix = preset.namePrefix;
743
743
 
744
- const serviceName = namePrefix ? `${accessoryName} ${name}` : name;
744
+ const serviceName1 = namePrefix ? `${accessoryName} ${name}` : name;
745
745
  const serviceType = preset.serviceType;
746
746
  const characteristicType = preset.characteristicType;
747
- const presetService = new serviceType(serviceName, `Preset ${deviceId} ${i}`);
747
+ const presetService = new serviceType(serviceName1, `Preset ${deviceId} ${i}`);
748
748
  presetService.addOptionalCharacteristic(Characteristic.ConfiguredName);
749
- presetService.setCharacteristic(Characteristic.ConfiguredName, serviceName);
749
+ presetService.setCharacteristic(Characteristic.ConfiguredName, serviceName1);
750
750
  presetService.getCharacteristic(characteristicType)
751
751
  .onGet(async () => {
752
752
  const state = preset.state;
@@ -797,10 +797,9 @@ class DeviceErv extends EventEmitter {
797
797
  //control
798
798
  if (i === 0) {
799
799
  if (this.logDebug) this.emit('debug', `Prepare schedule control service`);
800
- const serviceNameSchedule = namePrefix ? `${accessoryName} Schedule Control` : `Schedule Control`;
801
- this.schedulesControlService = new Service.Switch(serviceNameSchedule, `Schedule Control ${deviceId} ${i}`);
800
+ this.schedulesControlService = new Service.Switch(`${serviceName} Schedule`, `schedulesControlService${deviceId} ${i}`);
802
801
  this.schedulesControlService.addOptionalCharacteristic(Characteristic.ConfiguredName);
803
- this.schedulesControlService.setCharacteristic(Characteristic.ConfiguredName, serviceNameSchedule);
802
+ this.schedulesControlService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Schedules`);
804
803
  this.schedulesControlService.getCharacteristic(Characteristic.On)
805
804
  .onGet(async () => {
806
805
  const state = this.accessory.scheduleEnabled;
@@ -818,24 +817,24 @@ class DeviceErv extends EventEmitter {
818
817
  accessory.addService(this.schedulesControlService);
819
818
 
820
819
  if (this.logDebug) this.emit('debug', `Prepare schedule control sensor service`);
821
- this.scheduleSensorService = new Service.ContactSensor(serviceNameSchedule, `Schedule Control Sensor ${deviceId}`);
822
- this.scheduleSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
823
- this.scheduleSensorService.setCharacteristic(Characteristic.ConfiguredName, serviceNameSchedule);
824
- this.scheduleSensorService.getCharacteristic(Characteristic.ContactSensorState)
820
+ this.schedulesControlSensorService = new Service.ContactSensor(`${serviceName} Schedule Control`, `schedulesControlSensorService${deviceId}`);
821
+ this.schedulesControlSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
822
+ this.schedulesControlSensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Schedule Control`);
823
+ this.schedulesControlSensorService.getCharacteristic(Characteristic.ContactSensorState)
825
824
  .onGet(async () => {
826
825
  const state = this.accessory.scheduleEnabled;
827
826
  return state;
828
827
  })
829
- accessory.addService(this.scheduleSensorService);
828
+ accessory.addService(this.schedulesControlSensorService);
830
829
  }
831
830
 
832
831
  //sensors
833
- const serviceName = namePrefix ? `${accessoryName} ${name}` : name;
832
+ const serviceName1 = namePrefix ? `${accessoryName} ${name}` : name;
834
833
  const serviceType = schedule.serviceType;
835
834
  const characteristicType = schedule.characteristicType;
836
- const scheduleService = new serviceType(serviceName, `Schedule Sensor ${deviceId} ${i}`);
835
+ const scheduleService = new serviceType(serviceName1, `scheduleService${deviceId} ${i}`);
837
836
  scheduleService.addOptionalCharacteristic(Characteristic.ConfiguredName);
838
- scheduleService.setCharacteristic(Characteristic.ConfiguredName, serviceName);
837
+ scheduleService.setCharacteristic(Characteristic.ConfiguredName, serviceName1);
839
838
  scheduleService.getCharacteristic(characteristicType)
840
839
  .onGet(async () => {
841
840
  const state = schedule.state;
@@ -860,12 +859,12 @@ class DeviceErv extends EventEmitter {
860
859
  //get button name prefix
861
860
  const namePrefix = button.namePrefix;
862
861
 
863
- const serviceName = namePrefix ? `${accessoryName} ${buttonName}` : buttonName;
862
+ const serviceName1 = namePrefix ? `${accessoryName} ${buttonName}` : buttonName;
864
863
  const serviceType = button.serviceType;
865
864
  const characteristicType = button.characteristicType;
866
- const buttonService = new serviceType(serviceName, `Button ${deviceId} ${i}`);
865
+ const buttonService = new serviceType(serviceName1, `Button ${deviceId} ${i}`);
867
866
  buttonService.addOptionalCharacteristic(Characteristic.ConfiguredName);
868
- buttonService.setCharacteristic(Characteristic.ConfiguredName, serviceName);
867
+ buttonService.setCharacteristic(Characteristic.ConfiguredName, serviceName1);
869
868
  buttonService.getCharacteristic(characteristicType)
870
869
  .onGet(async () => {
871
870
  const state = button.state;