homebridge-melcloud-control 4.1.2-beta.31 → 4.1.2-beta.33
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 +38 -35
- package/package.json +1 -1
|
@@ -266,45 +266,48 @@
|
|
|
266
266
|
buttonsSensors: []
|
|
267
267
|
};
|
|
268
268
|
|
|
269
|
-
if (!devicesInConfig.some(dev => String(dev.id) ===
|
|
269
|
+
if (!devicesInConfig.some(dev => String(dev.id) === device.DeviceID)) {
|
|
270
270
|
devicesInConfig.push(deviceObj);
|
|
271
271
|
newArr.push(deviceObj);
|
|
272
272
|
}
|
|
273
273
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
const
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
deviceInConfig.presets
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
const
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
deviceInConfig.schedules
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
274
|
+
const deviceInConfig = devicesInConfig.find(dev => String(dev.id) === device.DeviceID);
|
|
275
|
+
if (deviceInConfig) {
|
|
276
|
+
if (account.type === 'melcloud') {
|
|
277
|
+
const presets = device.Presets || [];
|
|
278
|
+
presets.forEach((preset, index) => {
|
|
279
|
+
const presetObj = {
|
|
280
|
+
id: preset.ID,
|
|
281
|
+
displayType: 0,
|
|
282
|
+
name: preset.NumberDescription || `Preset ${index}`,
|
|
283
|
+
namePrefix: false
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
const presetsInConfig = deviceInConfig.presets || [];
|
|
287
|
+
if (!presetsInConfig.some(pres => String(pres.id) === preset.ID)) {
|
|
288
|
+
presetsInConfig.push(presetObj);
|
|
289
|
+
newPresets.push(presetObj);
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
if (account.type === 'melcloudhome') {
|
|
295
|
+
const schedules = device.Schedule || [];
|
|
296
|
+
schedules.forEach((schedule, index) => {
|
|
297
|
+
const scheduleObj = {
|
|
298
|
+
id: schedule.Id,
|
|
299
|
+
displayType: 0,
|
|
300
|
+
name: `Schedule ${index}`,
|
|
301
|
+
namePrefix: false
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
const schedulesInConfig = deviceInConfig.schedules || [];
|
|
305
|
+
if (!schedulesInConfig.some(sched => String(sched.id) === schedule.Id)) {
|
|
306
|
+
schedulesInConfig.push(scheduleObj);
|
|
307
|
+
newPresets.push(scheduleObj);
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
}
|
|
308
311
|
}
|
|
309
312
|
});
|
|
310
313
|
};
|
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.33",
|
|
5
5
|
"description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "grzegorz914",
|