homebridge-melcloud-control 4.0.0-beta.234 → 4.0.0-beta.236
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.
|
@@ -96,21 +96,16 @@
|
|
|
96
96
|
|
|
97
97
|
<script>
|
|
98
98
|
(async () => {
|
|
99
|
-
const
|
|
99
|
+
const pluginConfig = await homebridge.getPluginConfig();
|
|
100
100
|
|
|
101
|
-
if (!
|
|
102
|
-
|
|
103
|
-
await homebridge.updatePluginConfig(
|
|
101
|
+
if (!pluginConfig.length) {
|
|
102
|
+
pluginConfig.push({});
|
|
103
|
+
await homebridge.updatePluginConfig(pluginConfig);
|
|
104
104
|
homebridge.showSchemaForm();
|
|
105
105
|
return;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
config[0].accounts ??= [];
|
|
109
|
-
|
|
110
|
-
// 🧩 Deep clone — UI-safe copy (JSON method resets references)
|
|
111
|
-
const pluginConfig = JSON.parse(JSON.stringify(config));
|
|
112
108
|
this.accountIndex = 0;
|
|
113
|
-
|
|
114
109
|
const accounts = pluginConfig[0].accounts || [];
|
|
115
110
|
const accountsCount = accounts.length;
|
|
116
111
|
|
|
@@ -156,7 +151,6 @@
|
|
|
156
151
|
formElements.passwd.value = account.passwd || '';
|
|
157
152
|
formElements.language.value = account.language || '0';
|
|
158
153
|
formElements.accountType.value = account.type || 'disabled';
|
|
159
|
-
|
|
160
154
|
formElements.logIn.disabled = !(account.name && account.user && account.passwd && account.language && account.type);
|
|
161
155
|
});
|
|
162
156
|
});
|
|
@@ -183,9 +177,7 @@
|
|
|
183
177
|
|
|
184
178
|
document.getElementById('melCloudAccount').style.display = 'block';
|
|
185
179
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
// --- Config Button Toggle ---
|
|
180
|
+
// Config Button Toggle
|
|
189
181
|
const configButton = document.getElementById('configButton');
|
|
190
182
|
let configButtonState = false;
|
|
191
183
|
configButton.addEventListener('click', () => {
|
|
@@ -207,7 +199,7 @@
|
|
|
207
199
|
}
|
|
208
200
|
});
|
|
209
201
|
|
|
210
|
-
//
|
|
202
|
+
// Device Handling & Login Logic
|
|
211
203
|
function removeStaleDevices(configDevices, melcloudDevices) {
|
|
212
204
|
const melcloudIds = melcloudDevices.map(d => d.DeviceID);
|
|
213
205
|
const removedDevices = [];
|
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.
|
|
4
|
+
"version": "4.0.0-beta.236",
|
|
5
5
|
"description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "grzegorz914",
|