homebridge-melcloud-control 4.1.2-beta.82 → 4.1.2-beta.84
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.
|
@@ -213,7 +213,7 @@
|
|
|
213
213
|
|
|
214
214
|
for (let i = configDevices.length - 1; i >= 0; i--) {
|
|
215
215
|
const device = configDevices[i];
|
|
216
|
-
if (!melcloudIds.includes(device.id)) {
|
|
216
|
+
if (device.id !== "0" && !melcloudIds.includes(device.id)) {
|
|
217
217
|
removedDevices.push(device);
|
|
218
218
|
configDevices.splice(i, 1);
|
|
219
219
|
}
|
|
@@ -276,17 +276,6 @@
|
|
|
276
276
|
const deviceId = String(device.DeviceID);
|
|
277
277
|
let deviceInConfig = configDevicesMap.get(deviceId);
|
|
278
278
|
|
|
279
|
-
// === Remove placeholder devices with id '0' before adding new ===
|
|
280
|
-
const beforeDevicesCount = devicesInConfig.length;
|
|
281
|
-
devicesInConfig = devicesInConfig.filter(d => String(d.id) !== '0');
|
|
282
|
-
if (devicesInConfig.length !== beforeDevicesCount) {
|
|
283
|
-
updateInfo('info2', `Removed placeholder devices with id '0'`, 'yellow');
|
|
284
|
-
|
|
285
|
-
// Rebuild map after filtering
|
|
286
|
-
configDevicesMap.clear();
|
|
287
|
-
devicesInConfig.forEach(dev => configDevicesMap.set(String(dev.id), dev));
|
|
288
|
-
}
|
|
289
|
-
|
|
290
279
|
// === Create device if missing ===
|
|
291
280
|
if (!deviceInConfig) {
|
|
292
281
|
deviceInConfig = {
|
|
@@ -340,7 +329,8 @@
|
|
|
340
329
|
});
|
|
341
330
|
|
|
342
331
|
// Return filtered devicesInConfig to make sure upstream code uses it
|
|
343
|
-
|
|
332
|
+
const filteredDevices = devicesInConfig.filter(d => String(d.id) !== '0');
|
|
333
|
+
return filteredDevices;
|
|
344
334
|
} catch (error) {
|
|
345
335
|
updateInfo('info', `Error while processing device: ${JSON.stringify(error)}`, 'red');
|
|
346
336
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "MELCloud Control",
|
|
3
3
|
"name": "homebridge-melcloud-control",
|
|
4
|
-
"version": "4.1.2-beta.
|
|
4
|
+
"version": "4.1.2-beta.84",
|
|
5
5
|
"description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "grzegorz914",
|