homebridge-melcloud-control 4.3.9-beta.3 → 4.3.9-beta.5
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/homebridge-ui/public/index.html +13 -18
- package/package.json +1 -1
|
@@ -211,7 +211,7 @@
|
|
|
211
211
|
|
|
212
212
|
for (let i = configDevices.length - 1; i >= 0; i--) {
|
|
213
213
|
const device = configDevices[i];
|
|
214
|
-
if (
|
|
214
|
+
if (!melcloudIds.includes(device.id)) {
|
|
215
215
|
removedDevices.push(device);
|
|
216
216
|
configDevices.splice(i, 1);
|
|
217
217
|
}
|
|
@@ -255,9 +255,9 @@
|
|
|
255
255
|
if (device.Type === 3) devicesInMelCloudByType.erv.push(device);
|
|
256
256
|
});
|
|
257
257
|
|
|
258
|
-
account.ataDevices
|
|
259
|
-
account.atwDevices
|
|
260
|
-
account.ervDevices
|
|
258
|
+
account.ataDevices = (account.ataDevices ?? []).filter(d => String(d.id) !== "0");
|
|
259
|
+
account.atwDevices = (account.atwDevices ?? []).filter(d => String(d.id) !== "0");
|
|
260
|
+
account.ervDevices = (account.ervDevices ?? []).filter(d => String(d.id) !== "0");
|
|
261
261
|
|
|
262
262
|
const removedAta = removeStaleDevices(account.ataDevices, devicesInMelCloudByType.ata);
|
|
263
263
|
const removedAtw = removeStaleDevices(account.atwDevices, devicesInMelCloudByType.atw);
|
|
@@ -278,11 +278,7 @@
|
|
|
278
278
|
type: device.Type,
|
|
279
279
|
typeString,
|
|
280
280
|
displayType: 0,
|
|
281
|
-
name: device.DeviceName
|
|
282
|
-
presets: [],
|
|
283
|
-
schedules: [],
|
|
284
|
-
scenes: [],
|
|
285
|
-
buttonsSensors: []
|
|
281
|
+
name: device.DeviceName
|
|
286
282
|
};
|
|
287
283
|
devicesInConfig.push(deviceInConfig);
|
|
288
284
|
newDevices.push(deviceInConfig);
|
|
@@ -294,7 +290,7 @@
|
|
|
294
290
|
|
|
295
291
|
// === Process presets ===
|
|
296
292
|
const presetsInMelCloud = device.Presets || [];
|
|
297
|
-
const presetsInConfig = deviceInConfig.presets
|
|
293
|
+
const presetsInConfig = (deviceInConfig.presets ?? []).filter(p => String(p.id) !== "0");
|
|
298
294
|
const presetIds = new Set(presetsInConfig.map(p => String(p.id)));
|
|
299
295
|
|
|
300
296
|
let addedNewPreset = false;
|
|
@@ -317,7 +313,7 @@
|
|
|
317
313
|
// === Remove placeholder presets/schedules (id === '0') if new ones were added ===
|
|
318
314
|
if (addedNewPreset) {
|
|
319
315
|
const beforeCount = presetsInConfig.length;
|
|
320
|
-
deviceInConfig.presets = presetsInConfig
|
|
316
|
+
deviceInConfig.presets = presetsInConfig;
|
|
321
317
|
const removedCount = beforeCount - deviceInConfig.presets.length;
|
|
322
318
|
|
|
323
319
|
if (removedCount > 0 && removedCount < beforeCount) {
|
|
@@ -331,7 +327,7 @@
|
|
|
331
327
|
|
|
332
328
|
// === Process schedules ===
|
|
333
329
|
const schedulesInMelCloud = device.Schedule || [];
|
|
334
|
-
const schedulesInConfig = deviceInConfig.schedules
|
|
330
|
+
const schedulesInConfig = (deviceInConfig.schedules ?? []).filter(s => String(s.id) !== "0");
|
|
335
331
|
const scheduleIds = new Set(schedulesInConfig.map(s => String(s.id)));
|
|
336
332
|
|
|
337
333
|
let addedNewSchedule = false;
|
|
@@ -354,7 +350,7 @@
|
|
|
354
350
|
// === Remove placeholder schedules (id === '0') if new ones were added ===
|
|
355
351
|
if (addedNewSchedule) {
|
|
356
352
|
const beforeCount = schedulesInConfig.length;
|
|
357
|
-
deviceInConfig.schedules = schedulesInConfig
|
|
353
|
+
deviceInConfig.schedules = schedulesInConfig;
|
|
358
354
|
const removedCount = beforeCount - deviceInConfig.schedules.length;
|
|
359
355
|
|
|
360
356
|
if (removedCount > 0 && removedCount < beforeCount) {
|
|
@@ -363,7 +359,7 @@
|
|
|
363
359
|
}
|
|
364
360
|
|
|
365
361
|
// === Process scenes ===
|
|
366
|
-
const scenesInConfig = deviceInConfig.scenes
|
|
362
|
+
const scenesInConfig = (deviceInConfig.scenes ?? []).filter(s => String(s.id) !== "0");
|
|
367
363
|
const sceneIds = new Set(scenesInConfig.map(s => String(s.id)));
|
|
368
364
|
|
|
369
365
|
let addedNewScenes = false;
|
|
@@ -386,7 +382,7 @@
|
|
|
386
382
|
// === Remove placeholder scenes (id === '0') if new ones were added ===
|
|
387
383
|
if (addedNewScenes) {
|
|
388
384
|
const beforeCount = scenesInConfig.length;
|
|
389
|
-
deviceInConfig.scenes = scenesInConfig
|
|
385
|
+
deviceInConfig.scenes = scenesInConfig;
|
|
390
386
|
const removedCount = beforeCount - deviceInConfig.scenes.length;
|
|
391
387
|
|
|
392
388
|
if (removedCount > 0 && removedCount < beforeCount) {
|
|
@@ -397,8 +393,7 @@
|
|
|
397
393
|
});
|
|
398
394
|
|
|
399
395
|
// Return filtered devicesInConfig to make sure upstream code uses it
|
|
400
|
-
|
|
401
|
-
return filteredDevices;
|
|
396
|
+
return devicesInConfig;
|
|
402
397
|
} catch (error) {
|
|
403
398
|
updateInfo('info', `Error while processing device: ${JSON.stringify(error)}`, 'red');
|
|
404
399
|
}
|
|
@@ -433,7 +428,7 @@
|
|
|
433
428
|
updateInfo('info', `Prepare config error ${JSON.stringify(error)}`, 'red');
|
|
434
429
|
document.getElementById('logIn').className = "btn btn-secondary";
|
|
435
430
|
} finally {
|
|
436
|
-
|
|
431
|
+
document.getElementById('logIn').className = "btn btn-secondary";
|
|
437
432
|
homebridge.hideSpinner();
|
|
438
433
|
}
|
|
439
434
|
});
|
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.9-beta.
|
|
4
|
+
"version": "4.3.9-beta.5",
|
|
5
5
|
"description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "grzegorz914",
|