homebridge-melcloud-control 4.0.1-beta.5 → 4.0.1-beta.6
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.
|
@@ -257,32 +257,32 @@
|
|
|
257
257
|
|
|
258
258
|
const handleDevices = (devicesInMelCloud, devicesInConfig, typeString, newArr, newPresets) => {
|
|
259
259
|
devicesInMelCloud.forEach(device => {
|
|
260
|
-
const { DeviceID: id, Type: type, DeviceName: name, Presets: presets = [] } = device;
|
|
261
260
|
const deviceObj = {
|
|
262
|
-
id,
|
|
263
|
-
type,
|
|
261
|
+
id: device.DeviceID,
|
|
262
|
+
type: device.Type,
|
|
264
263
|
typeString,
|
|
265
|
-
name,
|
|
266
264
|
displayType: 0,
|
|
267
|
-
|
|
265
|
+
name: device.DeviceName,
|
|
266
|
+
presets: device.Presets ?? [],
|
|
268
267
|
buttonsSensors: []
|
|
269
268
|
};
|
|
270
269
|
|
|
271
|
-
if (!devicesInConfig.some(device => String(device.id) === id)) {
|
|
270
|
+
if (!devicesInConfig.some(device => String(device.id) === deviceObj.id)) {
|
|
272
271
|
devicesInConfig.push(deviceObj);
|
|
273
272
|
newArr.push(deviceObj);
|
|
274
273
|
}
|
|
275
274
|
|
|
275
|
+
const presets = device.Presets || [];
|
|
276
276
|
presets.forEach(preset => {
|
|
277
277
|
const presetObj = {
|
|
278
278
|
id: preset.ID,
|
|
279
|
-
name: preset.NumberDescription,
|
|
280
279
|
displayType: 0,
|
|
280
|
+
name: preset.NumberDescription,
|
|
281
281
|
namePrefix: false
|
|
282
282
|
};
|
|
283
283
|
|
|
284
|
-
const deviceInConfig = devicesInConfig.find(device => String(device.id) === id);
|
|
285
|
-
if (deviceInConfig && !deviceInConfig.presets.some(preset => preset.id ===
|
|
284
|
+
const deviceInConfig = devicesInConfig.find(device => String(device.id) === deviceObj.id);
|
|
285
|
+
if (deviceInConfig && !deviceInConfig.presets.some(preset => preset.id === presetObj.id)) {
|
|
286
286
|
deviceInConfig.presets.push(presetObj);
|
|
287
287
|
newPresets.push(presetObj);
|
|
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.6",
|
|
5
5
|
"description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "grzegorz914",
|