homebridge-melcloud-control 3.1.3-beta.12 → 3.1.3-beta.14

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.
@@ -157,16 +157,6 @@
157
157
  erv: []
158
158
  };
159
159
 
160
- //new found devices
161
- const newDevices = {
162
- ata: [],
163
- ataPresets: [],
164
- atw: [],
165
- atwPresets: [],
166
- erv: [],
167
- ervPresets: [],
168
- };
169
-
170
160
  //info text
171
161
  let textAta = 'ATA: 0';
172
162
  let textAtaPresets = 'ATA Presets: 0';
@@ -239,7 +229,7 @@
239
229
  ataDevices[index].presets.push(preset);
240
230
  };
241
231
  };
242
- textAtaPresets = `ATA Presets: ${ataDevices.presets.length}`
232
+ textAtaPresets = `ATA Presets: ${ataDevices[index].presets.length}`
243
233
  });
244
234
  textAta = `ATA: ${ataDevices.length}`
245
235
 
@@ -271,9 +261,9 @@
271
261
  buttonsSensors: []
272
262
  };
273
263
 
274
- const deviceExists = ataDevices.find(device => device.id === deviceId);
264
+ const deviceExists = atwDevices.find(device => device.id === deviceId);
275
265
  if (!deviceExists) {
276
- ataDevices.push(deviceAta);
266
+ atwDevices.push(deviceAtw);
277
267
  };
278
268
 
279
269
  //presets
@@ -298,7 +288,7 @@
298
288
  atwDevices[index].presets.push(preset);
299
289
  };
300
290
  };
301
- textAtwPresets = `ATW Presets: ${atwDevices.presets.length}`
291
+ textAtwPresets = `ATW Presets: ${atwDevices[index].presets.length}`
302
292
  });
303
293
  textAtw = `ATW: ${atwDevices.length}`
304
294
 
@@ -324,9 +314,9 @@
324
314
  buttonsSensors: []
325
315
  };
326
316
 
327
- const deviceExists = ataDevices.find(device => device.id === deviceId);
317
+ const deviceExists = ervDevices.find(device => device.id === deviceId);
328
318
  if (!deviceExists) {
329
- ataDevices.push(deviceAta);
319
+ ervDevices.push(deviceErv);
330
320
  };
331
321
 
332
322
  //presets
@@ -351,12 +341,12 @@
351
341
  ervDevices[index].presets.push(preset);
352
342
  };
353
343
  };
354
- textErvPresets = `ERV Presets: ${ervDevices.presets.length}`
344
+ textErvPresets = `ERV Presets: ${ervDevices[index].presets.length}`
355
345
  });
356
346
  textErv = `ERV: ${ervDevices.length}`
357
347
 
358
- const newDevicesCount = newDevices.ata.length + newDevices.atw.length + newDevices.erv.length ?? 0;
359
- const newPresetsCount = newDevices.ataPresets.length + newDevices.atwPresets.length + newDevices.ervPresets.length ?? 0;
348
+ const newDevicesCount = ataDevices[index].length + atwDevices[index].length + ervDevices[index].length ?? 0;
349
+ const newPresetsCount = ataDevices[index].presets.length + atwDevices[index].presets.length + ervDevices[index].presets.length ?? 0;
360
350
  if (newDevicesCount === 0 && newPresetsCount === 0) {
361
351
  document.getElementById('info').innerHTML = 'No new devices found.';
362
352
  document.getElementById('info').style.color = 'white';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "3.1.3-beta.12",
4
+ "version": "3.1.3-beta.14",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",