homebridge-melcloud-control 4.3.3-beta.15 → 4.3.3-beta.17

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 CHANGED
@@ -22,6 +22,15 @@ 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.2] - (xx.11.2025)
26
+
27
+ ## Changes
28
+
29
+ - fix presets report wrong state
30
+ - stability improvements
31
+ - bump dependencies
32
+ - cleanup
33
+
25
34
  # [4.3.2] - (21.11.2025)
26
35
 
27
36
  ## 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.3-beta.15",
4
+ "version": "4.3.3-beta.17",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
@@ -151,6 +151,7 @@ class MelCloudAta extends EventEmitter {
151
151
 
152
152
  this.headers = devicesData.Headers;
153
153
  const deviceData = devicesData.Devices.find(device => device.DeviceID === this.deviceId);
154
+ if (!deviceData) return;
154
155
  deviceData.Scenes = devicesData.Scenes ?? [];
155
156
 
156
157
  //web cocket connection
@@ -199,24 +200,29 @@ class MelCloudAta extends EventEmitter {
199
200
  switch (unitId) {
200
201
  case this.deviceId:
201
202
  const messageType = parsedMessage[0].messageType;
203
+ const settings = messageData.settings ? this.functions.parseArrayNameValue(messageData.settings) : [];
202
204
  switch (messageType) {
203
205
  case 'unitStateChanged':
204
- const deviceSettings = this.functions.parseArrayNameValue(messageData.settings);
205
- deviceData.Device.Power = deviceSettings.Power ?? deviceData.Device.Power;
206
- deviceData.Device.OperationMode = deviceSettings.OperationMode ?? deviceData.Device.OperationMode;
207
- deviceData.Device.RoomTemperature = deviceSettings.RoomTemperature ?? deviceData.Device.RoomTemperature;
208
- deviceData.Device.SetTemperature = deviceSettings.SetTemperature ?? deviceData.Device.SetTemperature;
209
- deviceData.Device.ActualFanSpeed = deviceSettings.ActualFanSpeed ?? deviceData.Device.ActualFanSpeed;
210
- deviceData.Device.SetFanSpeed = deviceSettings.SetFanSpeed ?? deviceData.Device.SetFanSpeed;
211
- deviceData.Device.VaneHorizontalDirection = deviceSettings.VaneHorizontalDirection ?? deviceData.Device.VaneHorizontalDirection;
212
- deviceData.Device.VaneVerticalDirection = deviceSettings.VaneVerticalDirection ?? deviceData.Device.VaneVerticalDirection;
213
- deviceData.HolidayMode.Enabled = deviceSettings.HolidayMode ?? deviceData.HolidayMode.Enabled;
206
+
207
+ //update values
208
+ for (const { key, value } of settings) {
209
+ if (!this.functions.isValidValue(value)) continue;
210
+
211
+ if (key === 'HolidayMode') {
212
+ deviceData.HolidayMode.Enabled = value;
213
+ continue;
214
+ }
215
+
216
+ //skip HolidayMode, update generic device fields
217
+ if (key in deviceData.Device) {
218
+ deviceData.Device[key] = value;
219
+ }
220
+ }
214
221
  updateState = true;
215
222
  break;
216
223
  case 'unitHolidayModeTriggered':
217
- const holidayModeSettings = this.functions.parseArrayNameValue(messageData.settings);
218
- deviceData.Device.Power = holidayModeSettings.Power;
219
- deviceData.HolidayMode.Enabled = holidayModeSettings.HolidayMode;
224
+ deviceData.Device.Power = settings.Power;
225
+ deviceData.HolidayMode.Enabled = settings.HolidayMode;
220
226
  deviceData.HolidayMode.Active = messageData.active;
221
227
  updateState = true;
222
228
  break;
@@ -145,6 +145,7 @@ class MelCloudAtw extends EventEmitter {
145
145
 
146
146
  this.headers = devicesData.Headers;
147
147
  const deviceData = devicesData.Devices.find(device => device.DeviceID === this.deviceId);
148
+ if (!deviceData) return;
148
149
  deviceData.Scenes = devicesData.Scenes ?? [];
149
150
 
150
151
  //web cocket connection
@@ -60,6 +60,7 @@ class MelCloudErv extends EventEmitter {
60
60
 
61
61
  this.headers = devicesData.Headers;
62
62
  const deviceData = devicesData.Devices.find(device => device.DeviceID === this.deviceId);
63
+ if (!deviceData) return;
63
64
  if (this.accountType === 'melcloudhome') {
64
65
  deviceData.Scenes = devicesData.Scenes ?? [];
65
66