homebridge-melcloud-control 4.4.0-beta.16 → 4.4.0-beta.18

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.4.0-beta.16",
4
+ "version": "4.4.0-beta.18",
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/functions.js CHANGED
@@ -257,7 +257,7 @@ class Functions extends EventEmitter {
257
257
  }
258
258
 
259
259
  // min maleje → zwracamy tylko min
260
- return { min, oldMax };
260
+ return { min, max };
261
261
  }
262
262
 
263
263
  if (type === "max") {
@@ -275,7 +275,7 @@ class Functions extends EventEmitter {
275
275
  }
276
276
 
277
277
  // max rośnie → zwracamy tylko max
278
- return { oldMin, max };
278
+ return { min, max };
279
279
  }
280
280
 
281
281
  return { min, max };
@@ -24,12 +24,15 @@ class MelCloudAta extends EventEmitter {
24
24
  //set default values
25
25
  this.deviceData = {};
26
26
  this.client = melcloud.client;
27
+ this.lock = false;
27
28
 
28
29
  //handle melcloud events
29
30
  let deviceData = null;
30
31
  melcloud.on('client', (client) => {
31
32
  this.client = client;
32
33
  }).on('devicesList', async (devicesData) => {
34
+ if (this.lock) return;
35
+
33
36
  try {
34
37
  deviceData = devicesData.Devices.find(device => device.DeviceID === this.deviceId);
35
38
  if (!deviceData) return;
@@ -321,9 +324,11 @@ class MelCloudAta extends EventEmitter {
321
324
  }
322
325
 
323
326
  update(deviceData) {
327
+ this.lock = true;
328
+ this.emit('deviceState', deviceData)
324
329
  setTimeout(() => {
325
- this.emit('deviceState', deviceData)
326
- }, 500);
330
+ this.lock = false;
331
+ }, 5000);
327
332
  }
328
333
  }
329
334