homebridge-melcloud-control 3.8.0-beta.14 → 3.8.0-beta.15

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/deviceatw.js +9 -9
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "3.8.0-beta.14",
4
+ "version": "3.8.0-beta.15",
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/deviceatw.js CHANGED
@@ -1338,16 +1338,21 @@ class DeviceAtw extends EventEmitter {
1338
1338
  const presetsOnServer = deviceData.Presets ?? [];
1339
1339
 
1340
1340
  //device info
1341
- const hasZone1 = this.hideZone === 1 || this.hideZone === 3 || this.hideZone === 5 || this.hideZone === 7 ? false : true;
1342
- const hasHotWaterTank = this.hideZone === 4 || this.hideZone === 5 || this.hideZone === 6 || this.hideZone === 7 || !deviceData.Device.HasHotWaterTank ? false : true;
1343
- const hasZone2 = this.hideZone === 2 || this.hideZone === 3 || this.hideZone === 6 || this.hideZone === 7 || !deviceData.Device.HasZone2 ? false : true;
1341
+ const hasZone1 = ![1, 3, 5, 7].includes(this.hideZone);
1342
+ const hasHotWaterTank = ![4, 5, 6, 7].includes(this.hideZone) && deviceData.Device.HasHotWaterTank;
1343
+ const hasZone2 = ![2, 3, 6, 7].includes(this.hideZone) && deviceData.Device.HasZone2;
1344
1344
  const canHeat = deviceData.Device.CanHeat ?? false;
1345
1345
  const canCool = deviceData.Device.CanCool ?? false;
1346
1346
  const heatCoolModes = canHeat && canCool ? 0 : canHeat ? 1 : canCool ? 2 : 3;
1347
1347
  const temperatureIncrement = deviceData.Device.TemperatureIncrement ?? 1;
1348
1348
  const minSetTemperature = deviceData.Device.MinSetTemperature ?? 10;
1349
1349
  const maxSetTemperature = deviceData.Device.MaxSetTemperature ?? 30;
1350
- const maxTankTemperature = deviceData.Device.MaxTankTemperature ?? 70
1350
+ const maxTankTemperature = deviceData.Device.MaxTankTemperature ?? 70;
1351
+
1352
+ //zone cases
1353
+ const caseZone1 = hasZone1 ? 1 : -1;
1354
+ const caseHotWater = hasHotWaterTank ? caseZone1 + 1 : -1;
1355
+ const caseZone2 = hasZone2 ? (hasHotWaterTank ? caseHotWater + 1 : caseZone1 + 1) : -1;
1351
1356
 
1352
1357
  //zones
1353
1358
  const zone1 = hasZone1 ? 1 : 0;
@@ -1355,11 +1360,6 @@ class DeviceAtw extends EventEmitter {
1355
1360
  const zone2 = hasZone2 ? 1 : 0;
1356
1361
  const zonesCount = 1 + zone1 + hotWater + zone2;
1357
1362
 
1358
- //zone cases
1359
- const caseZone1 = hasZone1 ? 1 : -1;
1360
- const caseHotWater = hasHotWaterTank ? 2 : -1;
1361
- const caseZone2 = hasZone2 ? hasHotWaterTank ? 3 : 2 : -1;
1362
-
1363
1363
  //heat pump
1364
1364
  const heatPumpName = 'Heat Pump';
1365
1365
  const power = deviceData.Device.Power ?? false;