homebridge-melcloud-control 4.0.0-beta.523 → 4.0.0-beta.524

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
@@ -200,7 +200,7 @@ class MelCloudPlatform {
200
200
 
201
201
  //start impulse generators\
202
202
  const timmers = accountType === 'melcloudhome' ? [{ name: 'connect', sampling: 900000 }, { name: 'checkDevicesList', sampling: deviceRefreshInterval }] : [{ name: 'checkDevicesList', sampling: refreshInterval }];
203
- await melCloud.impulseGenerator.state(true, timmers);
203
+ await melCloud.impulseGenerator.state(true, timmers, false);
204
204
  await configuredDevice.startStopImpulseGenerator(true, [{ name: 'checkState', sampling: deviceRefreshInterval }]);
205
205
 
206
206
  //stop impulse generator
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "4.0.0-beta.523",
4
+ "version": "4.0.0-beta.524",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
@@ -7,7 +7,7 @@ class ImpulseGenerator extends EventEmitter {
7
7
  this.timers = [];
8
8
  }
9
9
 
10
- async state(state, timers = []) {
10
+ async state(state, timers = [], runOnStart = true) {
11
11
  // Stop current timers before new start
12
12
  if (this.timersState && state) {
13
13
  await this.state(false);
@@ -19,7 +19,7 @@ class ImpulseGenerator extends EventEmitter {
19
19
  for (const { name, sampling } of timers) {
20
20
  if (!name || !sampling) continue;
21
21
 
22
- this.emit(name);
22
+ if (runOnStart) this.emit(name);
23
23
 
24
24
  const interval = setInterval(() => {
25
25
  this.emit(name);