homebridge-melcloud-control 4.10.2-beta.0 → 4.10.2

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
@@ -24,6 +24,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
24
24
  - For plugin < v4.6.0 use Homebridge UI <= v5.5.0
25
25
  - For plugin >= v4.6.0 use Homebridge UI >= v5.13.0
26
26
 
27
+ # [4.10.2] - (18.04.2026)
28
+
29
+ ## Changes
30
+
31
+ - fix [#243](https://github.com/grzegorz914/homebridge-melcloud-control/issues/243)
32
+ - cleanup
33
+
27
34
  # [4.10.1] - (17.04.2026)
28
35
 
29
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.10.2-beta.0",
4
+ "version": "4.10.2",
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/deviceerv.js CHANGED
@@ -431,7 +431,7 @@ class DeviceErv extends EventEmitter {
431
431
  this.melCloudAccountData.Account.LoginData.UseFahrenheit = value ? true : false;
432
432
  const payload = this.melCloudAccountData;
433
433
  if (this.logInfo) this.emit('info', `Set temperature display unit: ${TemperatureDisplayUnits[value]}`);
434
- await this.melCloudErv.send(this.accountType, this.displayType, deviceData, payload, 'account', this.melCloudAccountData);
434
+ await this.melCloudErv.send(this.accountType, this.displayType, deviceData, payload, 'account');
435
435
  } catch (error) {
436
436
  if (this.logWarn) this.emit('warn', `Set temperature display unit error: ${error}`);
437
437
  };
@@ -524,7 +524,7 @@ class DeviceErv extends EventEmitter {
524
524
  this.melCloudAccountData.Account.LoginData.UseFahrenheit = value ? true : false;
525
525
  const payload = this.melCloudAccountData;
526
526
  if (this.logInfo) this.emit('info', `Set temperature display unit: ${TemperatureDisplayUnits[value]}`);
527
- await this.melCloudErv.send(this.accountType, this.displayType, deviceData, payload, 'account', this.melCloudAccountData);
527
+ await this.melCloudErv.send(this.accountType, this.displayType, deviceData, payload, 'account');
528
528
  } catch (error) {
529
529
  if (this.logWarn) this.emit('warn', `Set temperature display unit error: ${error}`);
530
530
  };
package/src/melcloud.js CHANGED
@@ -39,7 +39,7 @@ class MelCloud extends EventEmitter {
39
39
  try {
40
40
  await fn();
41
41
  } catch (error) {
42
- this.emit('error', `Inpulse generator error: ${error}`);
42
+ this.emit('error', `Impulse generator error: ${error}`);
43
43
  } finally {
44
44
  this.locks[lockKey] = false;
45
45
  }
@@ -94,7 +94,7 @@ class MelCloudAta extends EventEmitter {
94
94
  }
95
95
 
96
96
  //update state
97
- if (this.logDebug) this.emit('debug', `Web socket update unit ${this.deviceId}settings: ${JSON.stringify(deviceData.Device, null, 2)}`);
97
+ if (this.logDebug) this.emit('debug', `Web socket update unit ${this.deviceId} settings: ${JSON.stringify(deviceData.Device, null, 2)}`);
98
98
  await this.updateState('ws', deviceData);
99
99
  } catch (error) {
100
100
  if (this.logError) this.emit('error', `Web socket unit ${this.deviceId} process message error: ${error}`);
@@ -285,7 +285,7 @@ class MelCloudAta extends EventEmitter {
285
285
  method = 'PUT';
286
286
  path = `${ApiUrls.Home.Put.SceneEnableDisable.replace('sceneid', payload.id)}/${payload.enabled ? 'enable' : 'disable'}`;
287
287
  const scene = deviceData.Scenes.find(s => s.Id === payload.id);
288
- scene.Enabled = payload.enabled;
288
+ if (scene) scene.Enabled = payload.enabled;
289
289
  payload = {};
290
290
  break;
291
291
  default:
@@ -315,18 +315,16 @@ class MelCloudAta extends EventEmitter {
315
315
 
316
316
  method = 'PUT';
317
317
  path = ApiUrls.Home.Put.Ata.replace('deviceid', deviceData.DeviceID);
318
+ deviceData.Device = { ...deviceData.Device, ...payload };
318
319
  break;
319
320
  }
320
321
 
321
322
  //send payload
322
323
  if (this.logDebug) this.emit('debug', `Send data: ${JSON.stringify(payload, null, 2)}`);
323
324
  await this.client(path, { method: method, data: payload });
324
-
325
- //update state
326
- deviceData.Device = { ...deviceData.Device, ...payload };
327
325
  return true;
328
326
  default:
329
- if (this.logWarn) this.emit('warn', `Received unknwn account type: ${accountType}`);
327
+ if (this.logWarn) this.emit('warn', `Received unknown account type: ${accountType}`);
330
328
  return;
331
329
  }
332
330
  } catch (error) {
@@ -248,7 +248,7 @@ class MelCloudAtw extends EventEmitter {
248
248
  method = 'PUT';
249
249
  path = `${ApiUrls.Home.Put.SceneEnableDisable.replace('sceneid', payload.id)}/${payload.enabled ? 'enable' : 'disable'}`;
250
250
  const scene = deviceData.Scenes.find(s => s.Id === payload.id);
251
- scene.Enabled = payload.enabled;
251
+ if (scene) scene.Enabled = payload.enabled;
252
252
  payload = {};
253
253
  break;
254
254
  default:
@@ -265,17 +265,15 @@ class MelCloudAtw extends EventEmitter {
265
265
 
266
266
  method = 'PUT';
267
267
  path = ApiUrls.Home.Put.Atw.replace('deviceid', deviceData.DeviceID);
268
+ deviceData.Device = { ...deviceData.Device, ...payload };
268
269
  break
269
270
  }
270
271
 
271
272
  if (this.logDebug) this.emit('debug', `Send data: ${JSON.stringify(payload, null, 2)}`);
272
273
  await this.client(path, { method: method, data: payload });
273
-
274
- //update state
275
- deviceData.Device = { ...deviceData.Device, ...payload };
276
274
  return true;
277
275
  default:
278
- if (this.logWarn) this.emit('warn', `Received unknwn account type: ${accountType}`);
276
+ if (this.logWarn) this.emit('warn', `Received unknown account type: ${accountType}`);
279
277
  return;
280
278
  }
281
279
  } catch (error) {
@@ -251,7 +251,7 @@ class MelCloudErv extends EventEmitter {
251
251
  method = 'PUT';
252
252
  path = `${ApiUrls.Home.Put.SceneEnableDisable.replace('sceneid', payload.id)}/${payload.enabled ? 'enable' : 'disable'}`;
253
253
  const scene = deviceData.Scenes.find(s => s.Id === payload.id);
254
- scene.Enabled = payload.enabled;
254
+ if (scene) scene.Enabled = payload.enabled;
255
255
  payload = {};
256
256
  break;
257
257
  default:
@@ -280,17 +280,15 @@ class MelCloudErv extends EventEmitter {
280
280
 
281
281
  method = 'PUT';
282
282
  path = ApiUrls.Home.Put.Erv.replace('deviceid', deviceData.DeviceID);
283
+ deviceData.Device = { ...deviceData.Device, ...payload };
283
284
  break
284
285
  }
285
286
 
286
287
  if (this.logDebug) this.emit('debug', `Send data: ${JSON.stringify(payload, null, 2)}`);
287
288
  await this.client(path, { method: method, data: payload });
288
-
289
- //update state
290
- deviceData.Device = { ...deviceData.Device, ...payload };
291
289
  return true;
292
290
  default:
293
- if (this.logWarn) this.emit('warn', `Received unknwn account type: ${accountType}`);
291
+ if (this.logWarn) this.emit('warn', `Received unknown account type: ${accountType}`);
294
292
  return;
295
293
  }
296
294
  } catch (error) {