homebridge-melcloud-control 4.0.1-beta.3 → 4.0.1-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.
@@ -257,8 +257,8 @@
257
257
 
258
258
  const handleDevices = (devicesInMelCloud, devicesInConfig, typeString, newArr, newPresets) => {
259
259
  devicesInMelCloud.forEach(device => {
260
- const { id: DeviceID, Type: type, DeviceName: name, Presets: presets = [] } = device;
261
- const devObj = structuredClone({
260
+ const { DeviceID: id, Type: type, DeviceName: name, Presets: presets = [] } = device;
261
+ const deviceObj = {
262
262
  id,
263
263
  type,
264
264
  typeString,
@@ -266,25 +266,25 @@
266
266
  displayType: 0,
267
267
  presets: [],
268
268
  buttonsSensors: []
269
- });
269
+ };
270
270
 
271
271
  if (!devicesInConfig.some(device => String(device.id) === id)) {
272
- devicesInConfig.push(devObj);
273
- newArr.push(structuredClone(devObj));
272
+ devicesInConfig.push(deviceObj);
273
+ newArr.push(deviceObj);
274
274
  }
275
275
 
276
276
  presets.forEach(preset => {
277
- const p = structuredClone({
277
+ const presetObj = {
278
278
  id: preset.ID,
279
279
  name: preset.NumberDescription,
280
280
  displayType: 0,
281
281
  namePrefix: false
282
- });
282
+ };
283
283
 
284
- const devConfig = devicesInConfig.find(device => String(device.id) === id);
285
- if (devConfig && !devConfig.presets.some(preset => preset.id === p.id)) {
286
- devConfig.presets.push(p);
287
- newPresets.push(structuredClone(p));
284
+ const deviceInConfig = devicesInConfig.find(device => String(device.id) === id);
285
+ if (deviceInConfig && !deviceInConfig.presets.some(preset => preset.id === p.id)) {
286
+ deviceInConfig.presets.push(presetObj);
287
+ newPresets.push(presetObj);
288
288
  }
289
289
  });
290
290
  });
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.3",
4
+ "version": "4.0.1-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",