homebridge-melcloud-control 4.0.0-beta.80 → 4.0.0-beta.82

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.
@@ -107,12 +107,13 @@
107
107
  this.accountIndex = 0;
108
108
  const accountsCount = pluginConfig[0].accounts.length;
109
109
  for (let i = 0; i < accountsCount; i++) {
110
+ const acc = pluginConfig[0].accounts[i];
110
111
  const button = document.createElement("button");
111
112
  button.type = "button";
112
113
  button.id = `button${i}`;
113
114
  button.className = "btn btn-primary";
114
115
  button.style.textTransform = 'none';
115
- button.innerText = pluginConfig[0].accounts[i].name;
116
+ button.innerText = acc.name;
116
117
  document.getElementById("accountButton").appendChild(button);
117
118
 
118
119
  button.addEventListener('click', async () => {
@@ -128,14 +129,13 @@
128
129
  document.getElementById('language').value = acc.language || '0';
129
130
  document.getElementById('displayType').value = acc.displayType || 'disabled';
130
131
  document.getElementById('logIn').disabled = !(acc.name && acc.user && acc.passwd && acc.language && acc.displayType);
131
- this.accountIndex = i;
132
132
  });
133
133
 
134
134
  if (i === accountsCount - 1) document.getElementById(`button0`).click();
135
+ this.accountIndex = i;
135
136
  }
136
137
 
137
138
  document.getElementById('melCloudAccount').style.display = 'block';
138
-
139
139
  document.getElementById('configForm').addEventListener('input', async () => {
140
140
  const acc = pluginConfig[0].accounts[this.accountIndex];
141
141
  acc.name = document.querySelector('#name').value;
@@ -263,8 +263,8 @@
263
263
  if (removedDevicesCount) updateInfo('info2', `Removed devices: ATA: ${removedAta.length}, ATW: ${removedAtw.length}, ERV: ${removedErv.length}.`, 'orange');
264
264
  }
265
265
 
266
- await homebridge.updatePluginConfig(acc);
267
- await homebridge.savePluginConfig(acc);
266
+ await homebridge.updatePluginConfig(pluginConfig);
267
+ await homebridge.savePluginConfig(pluginConfig);
268
268
  document.getElementById('logIn').className = "btn btn-secondary";
269
269
 
270
270
  } catch (error) {
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.0-beta.80",
4
+ "version": "4.0.0-beta.82",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",