homebridge-melcloud-control 4.1.2-beta.73 → 4.1.2-beta.74

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.
@@ -212,7 +212,7 @@
212
212
 
213
213
  for (let i = configDevices.length - 1; i >= 0; i--) {
214
214
  const device = configDevices[i];
215
- if (device.id !== "0" && !melcloudIds.includes(device.id)) {
215
+ if (!melcloudIds.includes(device.id)) {
216
216
  removedDevices.push(device);
217
217
  configDevices.splice(i, 1);
218
218
  }
@@ -275,8 +275,7 @@
275
275
  const typeKey1 = isMelcloud ? 'presets' : 'schedules';
276
276
 
277
277
  devicesInMelCloud.forEach(device => {
278
- const deviceId = String(device.DeviceID);
279
- let deviceInConfig = configDevicesMap.get(deviceId);
278
+ let deviceInConfig = configDevicesMap.get(device.DeviceID);
280
279
 
281
280
  // === Create device if missing ===
282
281
  if (!deviceInConfig) {
@@ -292,15 +291,15 @@
292
291
  };
293
292
  devicesInConfig.push(deviceInConfig);
294
293
  newArr.push(deviceInConfig);
295
- configDevicesMap.set(deviceId, deviceInConfig);
294
+ configDevicesMap.set(device.DeviceID, deviceInConfig);
296
295
  }
297
296
 
298
297
  // === Process presets/schedules ===
299
- const presets = device[typeKey] || [];
298
+ const presetsInMelcloud = device[typeKey] || [];
300
299
  const presetsInConfig = (deviceInConfig[typeKey1] || []).filter(p => String(p.id) !== '0');
301
300
  const presetIds = new Set(presetsInConfig.map(p => String(p.id)));
302
301
 
303
- presets.forEach((preset, index) => {
302
+ presetsInMelcloud.forEach((preset, index) => {
304
303
  const presetId = String(preset[idKey]);
305
304
  if (!presetIds.has(presetId)) {
306
305
  const presetObj = {
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.73",
4
+ "version": "4.1.2-beta.74",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",