homebridge-melcloud-control 4.1.2-beta.52 → 4.1.2-beta.54
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.
|
@@ -105,8 +105,7 @@
|
|
|
105
105
|
return;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
|
|
109
|
-
const accounts = pluginConfig.accounts || [];
|
|
108
|
+
const accounts = pluginConfig[0].accounts || [];
|
|
110
109
|
const accountsCount = accounts.length;
|
|
111
110
|
|
|
112
111
|
const container = document.getElementById("accountButton");
|
|
@@ -131,6 +130,8 @@
|
|
|
131
130
|
|
|
132
131
|
// Tworzenie przycisków
|
|
133
132
|
accounts.forEach((account, i) => {
|
|
133
|
+
this.account = account;
|
|
134
|
+
|
|
134
135
|
const button = document.createElement("button");
|
|
135
136
|
button.type = "button";
|
|
136
137
|
button.id = `button${i}`;
|
|
@@ -141,7 +142,6 @@
|
|
|
141
142
|
|
|
142
143
|
button.addEventListener('click', async () => {
|
|
143
144
|
this.account = account;
|
|
144
|
-
this.accountIndex = i;
|
|
145
145
|
|
|
146
146
|
// Zmieniamy klasę wszystkich przycisków
|
|
147
147
|
accounts.forEach((_, j) => {
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
|
|
168
168
|
// Jeden listener input dla całego formularza
|
|
169
169
|
document.getElementById('configForm').addEventListener('input', async () => {
|
|
170
|
-
const account =
|
|
170
|
+
const account = this.account;
|
|
171
171
|
if (!account) return;
|
|
172
172
|
|
|
173
173
|
account.name = formElements.name.value;
|
|
@@ -178,8 +178,8 @@
|
|
|
178
178
|
|
|
179
179
|
formElements.logIn.disabled = !(account.name && account.user && account.passwd && account.language && account.type);
|
|
180
180
|
|
|
181
|
-
await homebridge.updatePluginConfig(pluginConfig);
|
|
182
|
-
await homebridge.savePluginConfig(pluginConfig);
|
|
181
|
+
await homebridge.updatePluginConfig(pluginConfig[0]);
|
|
182
|
+
await homebridge.savePluginConfig(pluginConfig[0]);
|
|
183
183
|
});
|
|
184
184
|
|
|
185
185
|
document.getElementById('melCloudAccount').style.display = 'block';
|
|
@@ -366,8 +366,8 @@
|
|
|
366
366
|
updateInfo('info2', `Removed devices: ATA: ${removedAta.length}, ATW: ${removedAtw.length}, ERV: ${removedErv.length}.`, 'orange');
|
|
367
367
|
}
|
|
368
368
|
|
|
369
|
-
await homebridge.updatePluginConfig(pluginConfig);
|
|
370
|
-
await homebridge.savePluginConfig(pluginConfig);
|
|
369
|
+
await homebridge.updatePluginConfig(pluginConfig[0]);
|
|
370
|
+
await homebridge.savePluginConfig(pluginConfig[0]);
|
|
371
371
|
document.getElementById('logIn').className = "btn btn-secondary";
|
|
372
372
|
|
|
373
373
|
} 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.1.2-beta.
|
|
4
|
+
"version": "4.1.2-beta.54",
|
|
5
5
|
"description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "grzegorz914",
|