homebridge-melcloud-control 4.0.0-beta.78 → 4.0.0-beta.79

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.
@@ -176,12 +176,10 @@
176
176
  function removeStaleDevices(configDevices, melcloudDevices) {
177
177
  const melcloudIds = melcloudDevices.map(d => d.DeviceID);
178
178
  const removedDevices = [];
179
- const acc = pluginConfig[0].accounts[this.accountIndex];
180
179
 
181
180
  for (let i = configDevices.length - 1; i >= 0; i--) {
182
181
  const device = configDevices[i];
183
- const deviceId = acc.displayType === 'melcloud' ? parseInt(device.id) : device.id;
184
- if (deviceId !== 0 && !melcloudIds.includes(deviceId)) {
182
+ if (device.id !== 0 && !melcloudIds.includes(device.id)) {
185
183
  removedDevices.push(device);
186
184
  configDevices.splice(i, 1);
187
185
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "4.0.0-beta.78",
4
+ "version": "4.0.0-beta.79",
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/melcloud.js CHANGED
@@ -91,6 +91,14 @@ class MelCloud extends EventEmitter {
91
91
  ...buildingStructure.Areas.flatMap(area => area.Devices),
92
92
  ...buildingStructure.Devices
93
93
  ];
94
+
95
+ // Zamiana DeviceID na string
96
+ allDevices.forEach(device => {
97
+ if (device.DeviceID !== undefined && device.DeviceID !== null) {
98
+ device.DeviceID = device.DeviceID.toString();
99
+ }
100
+ });
101
+
94
102
  devices.push(...allDevices);
95
103
  }
96
104