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

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/index.js CHANGED
@@ -169,6 +169,7 @@ class MelCloudPlatform {
169
169
  const stopImpulseGenerator = startDone ? await impulseGenerator.stop() : false;
170
170
 
171
171
  //start impulse generator
172
+ const wait = stopImpulseGenerator ? await new Promise(resolve => setTimeout(resolve, 1500)) : false;
172
173
  const startImpulseGenerator = stopImpulseGenerator ? await airConditioner.startImpulseGenerator() : false
173
174
  } catch (error) {
174
175
  const emitLog = disableLogError ? false : log.error(`${accountName}, ${deviceTypeText}, ${deviceName}, ${error}, trying again.`);
@@ -235,6 +236,7 @@ class MelCloudPlatform {
235
236
  const stopImpulseGenerator = startDone ? await impulseGenerator.stop() : false;
236
237
 
237
238
  //start impulse generator
239
+ const wait = stopImpulseGenerator ? await new Promise(resolve => setTimeout(resolve, 1500)) : false;
238
240
  const startImpulseGenerator = stopImpulseGenerator ? await heatPump.startImpulseGenerator() : false
239
241
  } catch (error) {
240
242
  const emitLog = disableLogError ? false : log.error(`${accountName}, ${deviceTypeText}, ${deviceName}, ${error}, trying again.`);
@@ -301,6 +303,7 @@ class MelCloudPlatform {
301
303
  const stopImpulseGenerator = startDone ? await impulseGenerator.stop() : false;
302
304
 
303
305
  //start impulse generator
306
+ const wait = stopImpulseGenerator ? await new Promise(resolve => setTimeout(resolve, 1500)) : false;
304
307
  const startImpulseGenerator = stopImpulseGenerator ? await energyRecoveryVentilation.startImpulseGenerator() : false
305
308
  } catch (error) {
306
309
  const emitLog = disableLogError ? false : log.error(`${accountName}, ${deviceTypeText}, ${deviceName}, ${error}, trying again.`);
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.16",
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
@@ -1404,7 +1404,6 @@ class DeviceAta extends EventEmitter {
1404
1404
 
1405
1405
  //check state
1406
1406
  await this.melCloudAta.checkState();
1407
- await new Promise(resolve => setTimeout(resolve, 1000));
1408
1407
 
1409
1408
  return true;
1410
1409
  } catch (error) {
package/src/deviceatw.js CHANGED
@@ -1338,27 +1338,23 @@ 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
1351
 
1352
1352
  //zones
1353
- const zone1 = hasZone1 ? 1 : 0;
1354
- const hotWater = hasHotWaterTank ? 1 : 0;
1355
- const zone2 = hasZone2 ? 1 : 0;
1356
- const zonesCount = 1 + zone1 + hotWater + zone2;
1357
-
1358
- //zone cases
1359
- const caseZone1 = hasZone1 ? 1 : -1;
1360
- const caseHotWater = hasHotWaterTank ? 2 : -1;
1361
- const caseZone2 = hasZone2 ? hasHotWaterTank ? 3 : 2 : -1;
1353
+ let currentCase = 1;
1354
+ const caseZone1 = hasZone1 ? currentCase++ : -1;
1355
+ const caseHotWater = hasHotWaterTank ? currentCase++ : -1;
1356
+ const caseZone2 = hasZone2 ? currentCase++ : -1;
1357
+ const zonesCount = currentCase - 1;
1362
1358
 
1363
1359
  //heat pump
1364
1360
  const heatPumpName = 'Heat Pump';
@@ -1949,7 +1945,6 @@ class DeviceAtw extends EventEmitter {
1949
1945
 
1950
1946
  //check state
1951
1947
  await this.melCloudAtw.checkState();
1952
- await new Promise(resolve => setTimeout(resolve, 1000));
1953
1948
 
1954
1949
  return true;
1955
1950
  } catch (error) {
package/src/deviceerv.js CHANGED
@@ -1269,7 +1269,6 @@ class DeviceErv extends EventEmitter {
1269
1269
 
1270
1270
  //check state
1271
1271
  await this.melCloudErv.checkState();
1272
- await new Promise(resolve => setTimeout(resolve, 1000));
1273
1272
 
1274
1273
  return true;
1275
1274
  } catch (error) {