homebridge-melcloud-control 4.0.1-beta.0 → 4.0.1-beta.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.
|
@@ -255,9 +255,9 @@
|
|
|
255
255
|
const removedAtw = removeStaleDevices(account.atwDevices, devicesByType.atw);
|
|
256
256
|
const removedErv = removeStaleDevices(account.ervDevices, devicesByType.erv);
|
|
257
257
|
|
|
258
|
-
const handleDevices = (
|
|
259
|
-
|
|
260
|
-
const {
|
|
258
|
+
const handleDevices = (devicesInMelCloud, devicesInConfig, typeString, newArr, newPresets) => {
|
|
259
|
+
devicesInMelCloud.forEach(device => {
|
|
260
|
+
const { id: DeviceID, Type: type, DeviceName: name, Presets: presets = [] } = device;
|
|
261
261
|
const devObj = structuredClone({
|
|
262
262
|
id,
|
|
263
263
|
type,
|
|
@@ -268,7 +268,7 @@
|
|
|
268
268
|
buttonsSensors: []
|
|
269
269
|
});
|
|
270
270
|
|
|
271
|
-
if (!devicesInConfig.some(
|
|
271
|
+
if (!devicesInConfig.some(device => String(device.id) === id)) {
|
|
272
272
|
devicesInConfig.push(devObj);
|
|
273
273
|
newArr.push(structuredClone(devObj));
|
|
274
274
|
}
|
|
@@ -281,8 +281,8 @@
|
|
|
281
281
|
namePrefix: false
|
|
282
282
|
});
|
|
283
283
|
|
|
284
|
-
const devConfig = devicesInConfig.find(
|
|
285
|
-
if (devConfig && !devConfig.presets.some(
|
|
284
|
+
const devConfig = devicesInConfig.find(device => String(device.id) === id);
|
|
285
|
+
if (devConfig && !devConfig.presets.some(preset => preset.id === p.id)) {
|
|
286
286
|
devConfig.presets.push(p);
|
|
287
287
|
newPresets.push(structuredClone(p));
|
|
288
288
|
}
|
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.1-beta.
|
|
4
|
+
"version": "4.0.1-beta.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",
|