homebridge-melcloud-control 4.3.2-beta.20 → 4.3.2-beta.21

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.2-beta.20",
4
+ "version": "4.3.2-beta.21",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
@@ -149,15 +149,6 @@ class MelCloudAta extends EventEmitter {
149
149
  const deviceData = devicesData.Devices.find(device => device.DeviceID === this.deviceId);
150
150
  deviceData.Scenes = devicesData.Scenes ?? [];
151
151
 
152
- //check state changes
153
- const deviceDataNotChanged = JSON.stringify(deviceData) === JSON.stringify(this.deviceData);
154
- if (!deviceDataNotChanged) {
155
- this.deviceData = deviceData;
156
-
157
- //update state
158
- await this.updateState(deviceData);
159
- }
160
-
161
152
  //web cocket connection
162
153
  if (this.accountType === 'melcloudhome' && !this.connecting && !this.socketConnected) {
163
154
  this.connecting = true;
@@ -241,6 +232,14 @@ class MelCloudAta extends EventEmitter {
241
232
  }
242
233
  }
243
234
 
235
+ //check state changes
236
+ const deviceDataNotChanged = JSON.stringify(deviceData) === JSON.stringify(this.deviceData);
237
+ if (deviceDataNotChanged) return;
238
+ this.deviceData = deviceData;
239
+
240
+ //update state
241
+ await this.updateState(deviceData);
242
+
244
243
  return true;
245
244
  } catch (error) {
246
245
  throw new Error(`Check state error: ${error.message}`);