homebridge-melcloud-control 4.1.2-beta.41 → 4.1.2-beta.42
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 +17 -35
- package/package.json +1 -1
|
@@ -273,41 +273,23 @@
|
|
|
273
273
|
|
|
274
274
|
const deviceInConfig = devicesInConfig.find(dev => String(dev.id) === device.DeviceID);
|
|
275
275
|
if (deviceInConfig) {
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
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
|
-
}
|
|
276
|
+
const idKey = account.type === 'melcloud' ? 'ID' : 'Id';
|
|
277
|
+
const typeKey = account.type === 'melcloud' ? 'Presets' : 'Schedules';
|
|
278
|
+
const presets = device[typeKey] || [];
|
|
279
|
+
presets.forEach((preset, index) => {
|
|
280
|
+
const presetObj = {
|
|
281
|
+
id: preset[idKey],
|
|
282
|
+
displayType: 0,
|
|
283
|
+
name: preset.NumberDescription || `Schedule ${index}`,
|
|
284
|
+
namePrefix: false
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
const presetsInConfig = deviceInConfig.presets || [];
|
|
288
|
+
if (!presetsInConfig.some(pres => String(pres.id) === preset[idKey])) {
|
|
289
|
+
presetsInConfig.push(presetObj);
|
|
290
|
+
newPresets.push(presetObj);
|
|
291
|
+
}
|
|
292
|
+
});
|
|
311
293
|
}
|
|
312
294
|
});
|
|
313
295
|
};
|
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.42",
|
|
5
5
|
"description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "grzegorz914",
|