homebridge-melcloud-control 4.1.2-beta.76 → 4.1.2-beta.78

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.
@@ -240,6 +240,8 @@
240
240
  homebridge.showSpinner();
241
241
 
242
242
  try {
243
+ await homebridge.updatePluginConfig(pluginConfig);
244
+
243
245
  const account = this.account;
244
246
  const response = await homebridge.request('/connect', account);
245
247
  if (!response.State) {
@@ -265,7 +267,6 @@
265
267
  const removedAta = removeStaleDevices(account.ataDevices, melcloudDevices.ata);
266
268
  const removedAtw = removeStaleDevices(account.atwDevices, melcloudDevices.atw);
267
269
  const removedErv = removeStaleDevices(account.ervDevices, melcloudDevices.erv);
268
- await homebridge.updatePluginConfig(pluginConfig);
269
270
 
270
271
  const handleDevices = (devicesInMelCloud, devicesInConfig, typeString, newArr, newPresets) => {
271
272
  try {
@@ -324,9 +325,9 @@
324
325
  }
325
326
  };
326
327
 
327
- pluginConfig[0].account.ataDevices = handleDevices(melcloudDevices.ata, account.ataDevices, "Air Conditioner", newDevices.ata, newDevices.ataPresets);
328
- pluginConfig[0].account.atwDevices = handleDevices(melcloudDevices.atw, account.atwDevices, "Heat Pump", newDevices.atw, newDevices.atwPresets);
329
- pluginConfig[0].account.ervDevices = handleDevices(melcloudDevices.erv, account.ervDevices, "Energy Recovery Ventilation", newDevices.erv, newDevices.ervPresets);
328
+ account.ataDevices = handleDevices(melcloudDevices.ata, account.ataDevices, "Air Conditioner", newDevices.ata, newDevices.ataPresets);
329
+ account.atwDevices = handleDevices(melcloudDevices.atw, account.atwDevices, "Heat Pump", newDevices.atw, newDevices.atwPresets);
330
+ account.ervDevices = handleDevices(melcloudDevices.erv, account.ervDevices, "Energy Recovery Ventilation", newDevices.erv, newDevices.ervPresets);
330
331
 
331
332
  const newDevicesCount = newDevices.ata.length + newDevices.atw.length + newDevices.erv.length;
332
333
  const newPresetsCount = newDevices.ataPresets.length + newDevices.atwPresets.length + newDevices.ervPresets.length;
@@ -343,7 +344,6 @@
343
344
  updateInfo('info2', `Removed devices: ATA: ${removedAta.length}, ATW: ${removedAtw.length}, ERV: ${removedErv.length}.`, 'orange');
344
345
  }
345
346
 
346
- await homebridge.updatePluginConfig(pluginConfig);
347
347
  await homebridge.savePluginConfig(pluginConfig);
348
348
  } catch (error) {
349
349
  updateInfo('info', `Connect error ${JSON.stringify(error)}`, 'red');
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.76",
4
+ "version": "4.1.2-beta.78",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",