homebridge-melcloud-control 4.6.1-beta.13 → 4.6.1-beta.15

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,6 +84,7 @@
84
84
  <script>
85
85
  (async () => {
86
86
  const pluginConfig = await homebridge.getPluginConfig();
87
+ this.lightMode = homebridge.userCurrentLightingMode(); //return light, dark
87
88
 
88
89
  if (!pluginConfig.length) {
89
90
  pluginConfig.push({});
@@ -166,7 +167,7 @@
166
167
  formElements.logIn.disabled = !(account.name && account.user && account.passwd && account.language && account.type);
167
168
 
168
169
  await homebridge.updatePluginConfig(pluginConfig);
169
- await homebridge.savePluginConfig(pluginConfig);
170
+ await homebridge.savePluginConfig();
170
171
  });
171
172
 
172
173
  document.getElementById('melCloudAccount').style.display = 'block';
@@ -381,8 +382,9 @@
381
382
  const removedSchedulesCount = removedFromConfig.schedules.length;
382
383
  const removedScenesCount = removedFromConfig.scenes.length;
383
384
 
385
+ const fontColor = this.lightMode === 'dark' ? 'white' : 'black';
384
386
  if (!newDevicesCount && !newPresetsCount && !newSchedulesCount && !newScenesCount && !removedDevicesCount && !removedPresetsCount && !removedSchedulesCount && !removedScenesCount) {
385
- updateInfo('info', 'No changes detected.', 'white');
387
+ updateInfo('info', 'No changes detected.', fontColor);
386
388
  }
387
389
  if (newDevicesCount || newPresetsCount || newSchedulesCount || newScenesCount) {
388
390
  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');
@@ -392,9 +394,9 @@
392
394
  }
393
395
 
394
396
  await homebridge.updatePluginConfig(pluginConfig);
395
- await homebridge.savePluginConfig(pluginConfig);
397
+ await homebridge.savePluginConfig();
396
398
  } catch (error) {
397
- updateInfo('info', `Prepare config error`, "yellow");
399
+ updateInfo('info', `Prepare config error`, "red");
398
400
  updateInfo('info1', `Error: ${JSON.stringify(error)}`, "red");
399
401
  } finally {
400
402
  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.13",
4
+ "version": "4.6.1-beta.15",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",