homebridge-melcloud-control 4.2.3-beta.58 → 4.2.3-beta.59

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/deviceata.js +5 -5
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.3-beta.58",
4
+ "version": "4.2.3-beta.59",
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
@@ -911,7 +911,7 @@ class DeviceAta extends EventEmitter {
911
911
 
912
912
  //sensor
913
913
  if (this.logDebug) this.emit('debug', `Prepare preset control sensor s${name} ervice`);
914
- const presetControlSensorService = new serviceType(`${serviceName1} Control`, `presetControlSensorService${deviceId} ${i}`);
914
+ const presetControlSensorService = new serviceType(serviceName1, `presetControlSensorService${deviceId} ${i}`);
915
915
  presetControlSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
916
916
  presetControlSensorService.setCharacteristic(Characteristic.ConfiguredName, `${serviceName1} Control`);
917
917
  presetControlSensorService.getCharacteristic(characteristicType)
@@ -944,7 +944,7 @@ class DeviceAta extends EventEmitter {
944
944
  if (i === 0) {
945
945
  if (schedule.displayType > 3) {
946
946
  if (this.logDebug) this.emit('debug', `Prepare schedule control ${name} service`);
947
- this.scheduleControlService = new Service.Switch(`${serviceName1} Control`, `scheduleControlService${deviceId} ${i}`);
947
+ this.scheduleControlService = new Service.Switch(serviceName1, `scheduleControlService${deviceId} ${i}`);
948
948
  this.scheduleControlService.addOptionalCharacteristic(Characteristic.ConfiguredName);
949
949
  this.scheduleControlService.setCharacteristic(Characteristic.ConfiguredName, serviceName1);
950
950
  this.scheduleControlService.getCharacteristic(Characteristic.On)
@@ -1630,6 +1630,7 @@ class DeviceAta extends EventEmitter {
1630
1630
  if (this.presets.length > 0) {
1631
1631
  this.presets.forEach((preset, i) => {
1632
1632
  const presetData = presetsOnServer.find(p => p.ID === preset.id);
1633
+ const characteristicType = preset.characteristicType;
1633
1634
 
1634
1635
  preset.state = presetData ? (presetData.Power === power
1635
1636
  && presetData.SetTemperature === setTemperature
@@ -1638,7 +1639,6 @@ class DeviceAta extends EventEmitter {
1638
1639
  && presetData.VaneVerticalDirection === vaneVerticalDirection
1639
1640
  && presetData.FanSpeed === setFanSpeed) : false;
1640
1641
 
1641
- const characteristicType = preset.characteristicType;
1642
1642
  if (preset.displayType > 3) {
1643
1643
  this.presetControlServices?.[i]?.updateCharacteristic(Characteristic.On, preset.state);
1644
1644
  }
@@ -1650,8 +1650,8 @@ class DeviceAta extends EventEmitter {
1650
1650
  if (this.schedules.length > 0 && scheduleEnabled !== null) {
1651
1651
  this.schedules.forEach((schedule, i) => {
1652
1652
  const scheduleData = schedulesOnServer.find(s => s.Id === schedule.id);
1653
- schedule.state = scheduleEnabled ? scheduleData.Enabled ?? false : false;
1654
1653
  const characteristicType = schedule.characteristicType;
1654
+ schedule.state = scheduleEnabled ? scheduleData.Enabled ?? false : false;
1655
1655
 
1656
1656
  //control
1657
1657
  if (i === 0) {
@@ -1662,7 +1662,7 @@ class DeviceAta extends EventEmitter {
1662
1662
  }
1663
1663
 
1664
1664
  //sensors
1665
- this.schedulesServices?.[i]?.updateCharacteristic(characteristicType, schedule.state);
1665
+ this.scheduleSensorServices?.[i]?.updateCharacteristic(characteristicType, schedule.state);
1666
1666
  });
1667
1667
  };
1668
1668