homebridge-melcloud-control 4.1.2-beta.71 → 4.1.2-beta.72
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.
- package/homebridge-ui/public/index.html +11 -12
- package/package.json +1 -1
|
@@ -131,8 +131,6 @@
|
|
|
131
131
|
|
|
132
132
|
// Tworzenie przycisków
|
|
133
133
|
accounts.forEach((account, i) => {
|
|
134
|
-
this.accountIndex = i;
|
|
135
|
-
|
|
136
134
|
const button = document.createElement("button");
|
|
137
135
|
button.type = "button";
|
|
138
136
|
button.id = `button${i}`;
|
|
@@ -142,6 +140,7 @@
|
|
|
142
140
|
container.appendChild(button);
|
|
143
141
|
|
|
144
142
|
button.addEventListener('click', async () => {
|
|
143
|
+
this.accountIndex = i;
|
|
145
144
|
|
|
146
145
|
// Zmieniamy klasę wszystkich przycisków
|
|
147
146
|
accounts.forEach((_, j) => {
|
|
@@ -249,21 +248,21 @@
|
|
|
249
248
|
|
|
250
249
|
// Initialize devices arrays
|
|
251
250
|
const newDevices = { ata: [], ataPresets: [], atw: [], atwPresets: [], erv: [], ervPresets: [] };
|
|
252
|
-
const
|
|
251
|
+
const melcloud = { ata: [], atw: [], erv: [] };
|
|
253
252
|
|
|
254
253
|
response.Devices.forEach(d => {
|
|
255
|
-
if (d.Type === 0)
|
|
256
|
-
if (d.Type === 1)
|
|
257
|
-
if (d.Type === 3)
|
|
254
|
+
if (d.Type === 0) melcloud.ata.push(d);
|
|
255
|
+
if (d.Type === 1) melcloud.atw.push(d);
|
|
256
|
+
if (d.Type === 3) melcloud.erv.push(d);
|
|
258
257
|
});
|
|
259
258
|
|
|
260
259
|
account.ataDevices = (account.ataDevices || []).filter(d => String(d.id) !== '0');
|
|
261
260
|
account.atwDevices = (account.atwDevices || []).filter(d => String(d.id) !== '0');
|
|
262
261
|
account.ervDevices = (account.ervDevices || []).filter(d => String(d.id) !== '0');
|
|
263
262
|
|
|
264
|
-
const removedAta = removeStaleDevices(account.ataDevices,
|
|
265
|
-
const removedAtw = removeStaleDevices(account.atwDevices,
|
|
266
|
-
const removedErv = removeStaleDevices(account.ervDevices,
|
|
263
|
+
const removedAta = removeStaleDevices(account.ataDevices, melcloud.ata);
|
|
264
|
+
const removedAtw = removeStaleDevices(account.atwDevices, melcloud.atw);
|
|
265
|
+
const removedErv = removeStaleDevices(account.ervDevices, melcloud.erv);
|
|
267
266
|
|
|
268
267
|
const handleDevices = (devicesInMelCloud, devicesInConfig, typeString, newArr, newPresets) => {
|
|
269
268
|
try {
|
|
@@ -323,9 +322,9 @@
|
|
|
323
322
|
}
|
|
324
323
|
};
|
|
325
324
|
|
|
326
|
-
account.ataDevices = handleDevices(
|
|
327
|
-
account.atwDevices = handleDevices(
|
|
328
|
-
account.ervDevices = handleDevices(
|
|
325
|
+
account.ataDevices = handleDevices(melcloud.ata, account.ataDevices, "Air Conditioner", newDevices.ata, newDevices.ataPresets);
|
|
326
|
+
account.atwDevices = handleDevices(melcloud.atw, account.atwDevices, "Heat Pump", newDevices.atw, newDevices.atwPresets);
|
|
327
|
+
account.ervDevices = handleDevices(melcloud.erv, account.ervDevices, "Energy Recovery Ventilation", newDevices.erv, newDevices.ervPresets);
|
|
329
328
|
|
|
330
329
|
const newDevicesCount = newDevices.ata.length + newDevices.atw.length + newDevices.erv.length;
|
|
331
330
|
const newPresetsCount = newDevices.ataPresets.length + newDevices.atwPresets.length + newDevices.ervPresets.length;
|
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.72",
|
|
5
5
|
"description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "grzegorz914",
|