homebridge-melcloud-control 4.3.5-beta.10 → 4.3.5-beta.12

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.3.5-beta.10",
4
+ "version": "4.3.5-beta.12",
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
@@ -1877,10 +1877,8 @@ class DeviceAta extends EventEmitter {
1877
1877
  //start external integrations
1878
1878
  if (this.restFul.enable || this.mqtt.enable) await this.externalIntegrations();
1879
1879
 
1880
- //check state
1881
- await this.melCloudAta.updateState();
1882
-
1883
1880
  //prepare accessory
1881
+ await new Promise(r => setTimeout(r, 1000));
1884
1882
  const accessory = await this.prepareAccessory();
1885
1883
  return accessory;
1886
1884
  } catch (error) {
package/src/deviceatw.js CHANGED
@@ -2306,10 +2306,8 @@ class DeviceAtw extends EventEmitter {
2306
2306
  //start external integrations
2307
2307
  if (this.restFul.enable || this.mqtt.enable) await this.externalIntegrations();
2308
2308
 
2309
- //check state
2310
- await this.melCloudAtw.updateState();
2311
-
2312
2309
  //prepare accessory
2310
+ await new Promise(r => setTimeout(r, 1000));
2313
2311
  const accessory = await this.prepareAccessory();
2314
2312
  return accessory;
2315
2313
  } catch (error) {
package/src/deviceerv.js CHANGED
@@ -1580,10 +1580,8 @@ class DeviceErv extends EventEmitter {
1580
1580
  //start external integrations
1581
1581
  if (this.restFul.enable || this.mqtt.enable) await this.externalIntegrations();
1582
1582
 
1583
- //check state
1584
- await this.melCloudErv.updateState();
1585
-
1586
1583
  //prepare accessory
1584
+ await new Promise(r => setTimeout(r, 1000));
1587
1585
  const accessory = await this.prepareAccessory();
1588
1586
  return accessory;
1589
1587
  } catch (error) {
@@ -30,6 +30,7 @@ class MelCloudAta extends EventEmitter {
30
30
  let deviceData = null;
31
31
  melcloud.on('devicesList', async (devicesData) => {
32
32
  this.headers = devicesData.Headers;
33
+ const webSocket = devicesData.webSocket;
33
34
  deviceData = devicesData.Devices.find(device => device.DeviceID === this.deviceId);
34
35
  if (!deviceData) return;
35
36
  deviceData.Scenes = devicesData.Scenes ?? [];
@@ -38,7 +39,7 @@ class MelCloudAta extends EventEmitter {
38
39
  if (this.accountType === 'melcloudhome' && this.firtRun) {
39
40
  this.firtRun = false;
40
41
  try {
41
- devicesData.webSocket.on('message', async (message) => {
42
+ webSocket.on('message', async (message) => {
42
43
  const parsedMessage = JSON.parse(message);
43
44
  const stringifyMessage = JSON.stringify(parsedMessage, null, 2);
44
45
  if (parsedMessage.message === 'Forbidden') return;