homebridge-melcloud-control 4.6.6-beta.0 → 4.6.6

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/CHANGELOG.md CHANGED
@@ -24,6 +24,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
24
24
  - For plugin < v4.6.0 use Homebridge UI <= v5.5.0
25
25
  - For plugin >= v4.6.0 use Homebridge UI >= v5.13.0
26
26
 
27
+ # [4.6.6] - (23.01.2026)
28
+
29
+ ## Changes
30
+
31
+ - fix devices array initialization from UI on first run, fix [#231](https://github.com/grzegorz914/homebridge-melcloud-control/issues/231)
32
+ - config schema updated
33
+ - bump dependencies
34
+ - cleanup
35
+
27
36
  # [4.6.4] - (10.01.2026)
28
37
 
29
38
  ## Changes
@@ -13,7 +13,7 @@
13
13
  "name": {
14
14
  "title": "Platform",
15
15
  "type": "string",
16
- "default": "MELCLoud Control"
16
+ "default": "MELCloud Control"
17
17
  },
18
18
  "accounts": {
19
19
  "type": "array",
@@ -236,6 +236,15 @@
236
236
  return map;
237
237
  }
238
238
 
239
+ // Helper to generate summary string
240
+ function summarizeChanges(type, ata, atw, erv) {
241
+ const parts = [];
242
+ if (ata.length) parts.push(`ATA: ${ata.length}`);
243
+ if (atw.length) parts.push(`ATW: ${atw.length}`);
244
+ if (erv.length) parts.push(`ERV: ${erv.length}`);
245
+ return parts.length ? `${type}: ${parts.join(', ')}` : '';
246
+ }
247
+
239
248
  // Login & Sync Logic
240
249
  document.getElementById('logIn').addEventListener('click', async () => {
241
250
  document.getElementById('logIn').className = "btn btn-primary";
@@ -408,16 +417,23 @@
408
417
  const removedPresetsCount = removedFromConfig.presets.length;
409
418
  const removedSchedulesCount = removedFromConfig.schedules.length;
410
419
  const removedScenesCount = removedFromConfig.scenes.length;
411
-
412
- if (!newDevicesCount && !newPresetsCount && !newSchedulesCount && !newScenesCount && !removedDevicesCount && !removedPresetsCount && !removedSchedulesCount && !removedScenesCount) {
413
- updateInfo('info', 'No changes detected.', fontColor);
414
- }
415
- if (newDevicesCount || newPresetsCount || newSchedulesCount || newScenesCount) {
416
- 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');
417
- }
418
- if (removedDevicesCount || removedPresetsCount || removedSchedulesCount || removedScenesCount) {
419
- updateInfo('info1', `Removed old ${removedDevicesCount ? `devices:` : ''} ${removedFromConfig.ata.length ? `ATA: ${removedFromConfig.ata.length},` : ''} ${removedFromConfig.atw.length ? `ATW: ${removedFromConfig.atw.length},` : ''} ${removedFromConfig.erv.length ? `ERV: ${removedFromConfig.erv.length},` : ''} ${removedPresetsCount ? `presets: ${removedPresetsCount},` : ''} ${removedSchedulesCount ? `schedules: ${removedSchedulesCount},` : ''} ${removedScenesCount ? `scenes: ${removedScenesCount}` : ''}.`, 'orange');
420
- }
420
+ if (!newDevicesCount && !newPresetsCount && !newSchedulesCount && !newScenesCount && !removedDevicesCount && !removedPresetsCount && !removedSchedulesCount && !removedScenesCount) updateInfo('info', 'No changes detected.', fontColor);
421
+
422
+ // New items
423
+ const newParts = [];
424
+ if (newDevicesCount) newParts.push(summarizeChanges('Devices', newInMelCloud.ata, newInMelCloud.atw, newInMelCloud.erv));
425
+ if (account.type === 'melcloud' && newPresetsCount) newParts.push(summarizeChanges('Presets', newInMelCloud.ataPresets, newInMelCloud.atwPresets, newInMelCloud.ervPresets));
426
+ if (account.type === 'melcloudhome' && newSchedulesCount) newParts.push(summarizeChanges('Schedules', newInMelCloud.ataSchedules, newInMelCloud.atwSchedules, newInMelCloud.ervSchedules));
427
+ if (account.type === 'melcloudhome' && newScenesCount) newParts.push(summarizeChanges('Scenes', newInMelCloud.ataScenes, newInMelCloud.atwScenes, newInMelCloud.ervScenes));
428
+ if (newParts.length) updateInfo('info', `Found new: ${newParts.join('; ')}`, 'green');
429
+
430
+ // Removed items
431
+ const removedParts = [];
432
+ if (removedDevicesCount) removedParts.push(summarizeChanges('Devices', removedFromConfig.ata, removedFromConfig.atw, removedFromConfig.erv));
433
+ if (removedPresetsCount) removedParts.push(`Presets: ${removedPresetsCount}`);
434
+ if (removedSchedulesCount) removedParts.push(`Schedules: ${removedSchedulesCount}`);
435
+ if (removedScenesCount) removedParts.push(`Scenes: ${removedScenesCount}`);
436
+ if (removedParts.length) updateInfo('info1', `Removed old: ${removedParts.join('; ')}`, 'orange');
421
437
 
422
438
  await homebridge.updatePluginConfig(pluginConfig);
423
439
  await homebridge.savePluginConfig();
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.6-beta.0",
4
+ "version": "4.6.6",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",