homebridge-melcloud-control 4.6.1-beta.14 → 4.6.1-beta.16
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.
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
<script>
|
|
85
85
|
(async () => {
|
|
86
86
|
const pluginConfig = await homebridge.getPluginConfig();
|
|
87
|
-
|
|
87
|
+
this.themeMode = homebridge.userCurrentLightingMode(); //return light, dark
|
|
88
88
|
|
|
89
89
|
if (!pluginConfig.length) {
|
|
90
90
|
pluginConfig.push({});
|
|
@@ -269,10 +269,6 @@
|
|
|
269
269
|
};
|
|
270
270
|
|
|
271
271
|
// Clean up local config
|
|
272
|
-
account.ataDevices = (account.ataDevices ?? []).filter(d => String(d.id) !== '0' && String(d.id) !== null);
|
|
273
|
-
account.atwDevices = (account.atwDevices ?? []).filter(d => String(d.id) !== '0' && String(d.id) !== null);
|
|
274
|
-
account.ervDevices = (account.ervDevices ?? []).filter(d => String(d.id) !== '0' && String(d.id) !== null);
|
|
275
|
-
|
|
276
272
|
const removedFromConfig = { ata: [], atw: [], erv: [], presets: [], schedules: [], scenes: [] };
|
|
277
273
|
removedFromConfig.ata = removeStaleEntities(account.ataDevices, devicesInMelCloudByType.ata, d => d.id, d => d.DeviceID);
|
|
278
274
|
removedFromConfig.atw = removeStaleEntities(account.atwDevices, devicesInMelCloudByType.atw, d => d.id, d => d.DeviceID);
|
|
@@ -382,8 +378,9 @@
|
|
|
382
378
|
const removedSchedulesCount = removedFromConfig.schedules.length;
|
|
383
379
|
const removedScenesCount = removedFromConfig.scenes.length;
|
|
384
380
|
|
|
381
|
+
const fontColor = this.themeMode === 'dark' ? 'white' : 'black';
|
|
385
382
|
if (!newDevicesCount && !newPresetsCount && !newSchedulesCount && !newScenesCount && !removedDevicesCount && !removedPresetsCount && !removedSchedulesCount && !removedScenesCount) {
|
|
386
|
-
updateInfo('info', 'No changes detected.',
|
|
383
|
+
updateInfo('info', 'No changes detected.', fontColor);
|
|
387
384
|
}
|
|
388
385
|
if (newDevicesCount || newPresetsCount || newSchedulesCount || newScenesCount) {
|
|
389
386
|
updateInfo('info', `Found new ${newDevicesCount ? `devices:` : ''} ${newInMelCloud.ata.length ? `ATA: ${newInMelCloud.ata.length},` : ''} ${newInMelCloud.atw.length ? `ATW: ${newInMelCloud.atw.length},` : ''} ${newInMelCloud.erv.length ? `ERV: ${newInMelCloud.erv.length},` : ''} ${newPresetsCount ? `presets:` : ''} ${newInMelCloud.ataPresets.length ? `ATA: ${newInMelCloud.ataPresets.length},` : ''} ${newInMelCloud.atwPresets.length ? `ATW: ${newInMelCloud.atwPresets.length}, ` : ''} ${newInMelCloud.ervPresets.length ? `ERV: ${newInMelCloud.ervPresets.length},` : ''} ${newSchedulesCount ? `schedules:` : ''} ${newInMelCloud.ataSchedules.length ? `ATA: ${newInMelCloud.ataSchedules.length},` : ''} ${newInMelCloud.atwSchedules.length ? `ATW: ${newInMelCloud.atwSchedules.length},` : ''} ${newInMelCloud.ervSchedules.length ? `ERV: ${newInMelCloud.ervSchedules.length}, ` : ''} ${newScenesCount ? `scenes:` : ''} ${newInMelCloud.ataScenes.length ? `ATA: ${newInMelCloud.ataScenes.length},` : ''} ${newInMelCloud.atwScenes.length ? `ATW: ${newInMelCloud.atwScenes.length},` : ''} ${newInMelCloud.ervScenes.length ? `ERV: ${newInMelCloud.ervScenes.length}` : ''}.`, 'green');
|
|
@@ -395,7 +392,7 @@
|
|
|
395
392
|
await homebridge.updatePluginConfig(pluginConfig);
|
|
396
393
|
await homebridge.savePluginConfig();
|
|
397
394
|
} catch (error) {
|
|
398
|
-
updateInfo('info', `Prepare config error`, "
|
|
395
|
+
updateInfo('info', `Prepare config error`, "red");
|
|
399
396
|
updateInfo('info1', `Error: ${JSON.stringify(error)}`, "red");
|
|
400
397
|
} finally {
|
|
401
398
|
document.getElementById('logIn').className = "btn btn-secondary";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "MELCloud Control",
|
|
3
3
|
"name": "homebridge-melcloud-control",
|
|
4
|
-
"version": "4.6.1-beta.
|
|
4
|
+
"version": "4.6.1-beta.16",
|
|
5
5
|
"description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "grzegorz914",
|