homebridge-melcloud-control 4.0.0-beta.93 → 4.0.0-beta.95
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,16 +96,19 @@
|
|
|
96
96
|
|
|
97
97
|
<script>
|
|
98
98
|
(async () => {
|
|
99
|
-
const
|
|
99
|
+
const config = await homebridge.getPluginConfig();
|
|
100
100
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
await homebridge.updatePluginConfig(pluginConfig);
|
|
101
|
+
if (!config.length) {
|
|
102
|
+
config.push({ accounts: [] });
|
|
103
|
+
await homebridge.updatePluginConfig(config);
|
|
105
104
|
homebridge.showSchemaForm();
|
|
106
105
|
return;
|
|
107
106
|
}
|
|
108
|
-
|
|
107
|
+
|
|
108
|
+
config[0].accounts ??= [];
|
|
109
|
+
|
|
110
|
+
// 🧩 Deep clone — UI-safe copy (JSON method resets references)
|
|
111
|
+
const pluginConfig = JSON.parse(JSON.stringify(config));
|
|
109
112
|
|
|
110
113
|
this.accountIndex = 0;
|
|
111
114
|
const accountsCount = pluginConfig[0].accounts.length;
|
|
@@ -154,9 +157,6 @@
|
|
|
154
157
|
acc.displayType = document.querySelector('#displayType').value;
|
|
155
158
|
|
|
156
159
|
document.getElementById('logIn').disabled = !(acc.name && acc.user && acc.passwd && acc.language && acc.displayType);
|
|
157
|
-
|
|
158
|
-
await homebridge.updatePluginConfig(pluginConfig);
|
|
159
|
-
await homebridge.savePluginConfig(pluginConfig);
|
|
160
160
|
});
|
|
161
161
|
|
|
162
162
|
// --- Config Button Toggle ---
|
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.95",
|
|
5
5
|
"description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "grzegorz914",
|