homebridge-melcloud-control 4.3.0-beta.47 → 4.3.0-beta.49
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/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/src/melcloudata.js +10 -9
package/CHANGELOG.md
CHANGED
|
@@ -22,6 +22,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
22
22
|
|
|
23
23
|
- Do not use Homebridge UI > v5.5.0 because of break config.json
|
|
24
24
|
|
|
25
|
+
# [4.3.0] - (xx.11.2025)
|
|
26
|
+
|
|
27
|
+
## Changes
|
|
28
|
+
|
|
29
|
+
- use web socket for realtime communication with MELCloud Home
|
|
30
|
+
- readme updated
|
|
31
|
+
- cleanup
|
|
32
|
+
|
|
25
33
|
# [4.2.8] - (18.11.2025)
|
|
26
34
|
|
|
27
35
|
## Changes
|
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.
|
|
4
|
+
"version": "4.3.0-beta.49",
|
|
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/melcloudata.js
CHANGED
|
@@ -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;
|
|
@@ -149,6 +144,7 @@ class MelCloudAta extends EventEmitter {
|
|
|
149
144
|
const messageData = parsedMessage?.[0]?.Data;
|
|
150
145
|
if (!messageData) return;
|
|
151
146
|
|
|
147
|
+
let updateDeiceState = false;
|
|
152
148
|
const unitId = messageData?.id;
|
|
153
149
|
switch (unitId) {
|
|
154
150
|
case this.deviceId:
|
|
@@ -163,13 +159,11 @@ class MelCloudAta extends EventEmitter {
|
|
|
163
159
|
return [name, parsedValue];
|
|
164
160
|
}));
|
|
165
161
|
Object.assign(deviceData.Device, settings);
|
|
166
|
-
|
|
167
|
-
this.emit('deviceState', deviceData);
|
|
162
|
+
updateDeiceState = true;
|
|
168
163
|
break;
|
|
169
164
|
case 'unitWifiSignalChanged':
|
|
170
165
|
Object.assign(deviceData, messageData.rssi);
|
|
171
|
-
|
|
172
|
-
this.emit('deviceState', deviceData);
|
|
166
|
+
updateDeiceState = true;
|
|
173
167
|
break;
|
|
174
168
|
default:
|
|
175
169
|
if (this.logWarn) this.emit('warn', `Unit ${unitId}, received unknown message type: ${stringifyMessage}`);
|
|
@@ -180,6 +174,8 @@ class MelCloudAta extends EventEmitter {
|
|
|
180
174
|
if (this.logWarn) this.emit('warn', `Incoming unknown unit id: ${stringifyMessage}`);
|
|
181
175
|
return;
|
|
182
176
|
}
|
|
177
|
+
|
|
178
|
+
if (updateDeiceState) this.emit('deviceState', deviceData);
|
|
183
179
|
});
|
|
184
180
|
} catch (error) {
|
|
185
181
|
if (this.logError) this.emit('error', `Socket connection failed: ${error}`);
|
|
@@ -228,6 +224,11 @@ class MelCloudAta extends EventEmitter {
|
|
|
228
224
|
this.emit('mqtt', 'State', deviceData.Device);
|
|
229
225
|
}
|
|
230
226
|
|
|
227
|
+
//check state changes
|
|
228
|
+
const deviceDataHasNotChanged = JSON.stringify(deviceData) === JSON.stringify(this.deviceData);
|
|
229
|
+
if (deviceDataHasNotChanged) return;
|
|
230
|
+
this.deviceData = deviceData;
|
|
231
|
+
|
|
231
232
|
//emit info
|
|
232
233
|
this.emit('deviceInfo', indoor.model, outdoor.model, serialNumber, firmwareAppVersion);
|
|
233
234
|
|