homebridge-melcloud-control 4.3.0-beta.47 → 4.3.0-beta.48

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.0-beta.47",
4
+ "version": "4.3.0-beta.48",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
@@ -92,11 +92,6 @@ class MelCloudAta extends EventEmitter {
92
92
  this.headers = devicesData.Headers;
93
93
  const deviceData = devicesData.Devices.find(device => device.DeviceID === this.deviceId);
94
94
 
95
- //check state changes
96
- const deviceDataHasNotChanged = JSON.stringify(deviceData) === JSON.stringify(this.deviceData);
97
- if (deviceDataHasNotChanged) return;
98
- this.deviceData = deviceData;
99
-
100
95
  if (this.accountType === 'melcloudhome') {
101
96
  deviceData.Scenes = devicesData.Scenes ?? [];
102
97
  deviceData.Device.OperationMode = AirConditioner.OperationModeMapStringToEnum[deviceData.Device.OperationMode] ?? deviceData.Device.OperationMode;
@@ -228,6 +223,11 @@ class MelCloudAta extends EventEmitter {
228
223
  this.emit('mqtt', 'State', deviceData.Device);
229
224
  }
230
225
 
226
+ //check state changes
227
+ const deviceDataHasNotChanged = JSON.stringify(deviceData) === JSON.stringify(this.deviceData);
228
+ if (deviceDataHasNotChanged) return;
229
+ this.deviceData = deviceData;
230
+
231
231
  //emit info
232
232
  this.emit('deviceInfo', indoor.model, outdoor.model, serialNumber, firmwareAppVersion);
233
233