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

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.
@@ -230,6 +230,7 @@
230
230
 
231
231
  document.getElementById('logIn').addEventListener('click', async () => {
232
232
  await homebridge.updatePluginConfig(pluginConfig);
233
+ await homebridge.savePluginConfig(pluginConfig);
233
234
 
234
235
  document.getElementById(`logIn`).className = "btn btn-primary";
235
236
  updateInfo('info', '', 'white');
@@ -248,21 +249,21 @@
248
249
 
249
250
  // Initialize devices arrays
250
251
  const newDevices = { ata: [], ataPresets: [], atw: [], atwPresets: [], erv: [], ervPresets: [] };
251
- const melcloud = { ata: [], atw: [], erv: [] };
252
+ const melcloudDevices = { ata: [], atw: [], erv: [] };
252
253
 
253
254
  response.Devices.forEach(d => {
254
- if (d.Type === 0) melcloud.ata.push(d);
255
- if (d.Type === 1) melcloud.atw.push(d);
256
- if (d.Type === 3) melcloud.erv.push(d);
255
+ if (d.Type === 0) melcloudDevices.ata.push(d);
256
+ if (d.Type === 1) melcloudDevices.atw.push(d);
257
+ if (d.Type === 3) melcloudDevices.erv.push(d);
257
258
  });
258
259
 
259
260
  account.ataDevices = (account.ataDevices || []).filter(d => String(d.id) !== '0');
260
261
  account.atwDevices = (account.atwDevices || []).filter(d => String(d.id) !== '0');
261
262
  account.ervDevices = (account.ervDevices || []).filter(d => String(d.id) !== '0');
262
263
 
263
- const removedAta = removeStaleDevices(account.ataDevices, melcloud.ata);
264
- const removedAtw = removeStaleDevices(account.atwDevices, melcloud.atw);
265
- const removedErv = removeStaleDevices(account.ervDevices, melcloud.erv);
264
+ const removedAta = removeStaleDevices(account.ataDevices, melcloudDevices.ata);
265
+ const removedAtw = removeStaleDevices(account.atwDevices, melcloudDevices.atw);
266
+ const removedErv = removeStaleDevices(account.ervDevices, melcloudDevices.erv);
266
267
 
267
268
  const handleDevices = (devicesInMelCloud, devicesInConfig, typeString, newArr, newPresets) => {
268
269
  try {
@@ -322,9 +323,9 @@
322
323
  }
323
324
  };
324
325
 
325
- account.ataDevices = handleDevices(melcloud.ata, account.ataDevices, "Air Conditioner", newDevices.ata, newDevices.ataPresets);
326
- account.atwDevices = handleDevices(melcloud.atw, account.atwDevices, "Heat Pump", newDevices.atw, newDevices.atwPresets);
327
- account.ervDevices = handleDevices(melcloud.erv, account.ervDevices, "Energy Recovery Ventilation", newDevices.erv, newDevices.ervPresets);
326
+ account.ataDevices = handleDevices(melcloudDevices.ata, account.ataDevices, "Air Conditioner", newDevices.ata, newDevices.ataPresets);
327
+ account.atwDevices = handleDevices(melcloudDevices.atw, account.atwDevices, "Heat Pump", newDevices.atw, newDevices.atwPresets);
328
+ account.ervDevices = handleDevices(melcloudDevices.erv, account.ervDevices, "Energy Recovery Ventilation", newDevices.erv, newDevices.ervPresets);
328
329
 
329
330
  const newDevicesCount = newDevices.ata.length + newDevices.atw.length + newDevices.erv.length;
330
331
  const newPresetsCount = newDevices.ataPresets.length + newDevices.atwPresets.length + newDevices.ervPresets.length;
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.72",
4
+ "version": "4.1.2-beta.73",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",