@homebridge-plugins/homebridge-ecovacs 8.2.0-beta.1 → 8.2.0-beta.2

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
@@ -8,6 +8,7 @@ All notable changes to `@homebridge-plugins/homebridge-ecovacs` will be document
8
8
 
9
9
  - feat(ui): add, remove and hide devices from the config via the my devices tab
10
10
  - style(ui): standardise the custom ui layout and sync the support tab with the readme
11
+ - feat(ui): add a remove all devices action to the my devices tab
11
12
 
12
13
  ## v8.1.4 (2026-07-19)
13
14
 
@@ -108,6 +108,17 @@
108
108
  </button>
109
109
  </div>
110
110
  </li>
111
+ <li class="list-group-item">
112
+ <div class="d-flex justify-content-between align-items-center">
113
+ <div class="pr-2">
114
+ <div>Remove All Devices</div>
115
+ <div class="text-muted action-desc" id="removeAllText">Remove every device from the plugin config.</div>
116
+ </div>
117
+ <button type="button" class="btn btn-primary m-0 ml-3 py-1 min-w-50" id="removeAllBtn" aria-label="Remove all devices from the config">
118
+ <i aria-hidden="true" class="fas fa-arrow-right"></i>
119
+ </button>
120
+ </div>
121
+ </li>
111
122
  <li class="list-group-item">
112
123
  <div class="d-flex justify-content-between align-items-center">
113
124
  <div class="pr-2">
@@ -239,6 +250,7 @@
239
250
  // so staged-but-unsaved edits made in the Settings tab are respected
240
251
  let pickerAccessories = [];
241
252
  let removeConfirmTimer;
253
+ let removeAllConfirmTimer;
242
254
 
243
255
  // The action buttons always show the settings-page arrow; the row text
244
256
  // (and the button's aria-label) says what the arrow will do
@@ -464,6 +476,51 @@
464
476
  homebridge.toast.error(err.message, "Error");
465
477
  }
466
478
  });
479
+ const resetRemoveAllButton = () => {
480
+ const btn = document.getElementById('removeAllBtn');
481
+ clearTimeout(removeAllConfirmTimer);
482
+ delete btn.dataset.confirm;
483
+ btn.classList.remove('btn-danger');
484
+ btn.classList.add('btn-primary');
485
+ btn.innerHTML = actionArrow;
486
+ btn.setAttribute('aria-label', 'Remove all devices from the config');
487
+ document.getElementById('removeAllText').innerHTML = 'Remove every device from the plugin config.';
488
+ };
489
+
490
+ document.getElementById('removeAllBtn').addEventListener('click', async () => {
491
+ try {
492
+ const btn = document.getElementById('removeAllBtn');
493
+ const blocks = await getConfigBlocks();
494
+ const config = blocks[0];
495
+ const total = Array.isArray(config.devices) ? config.devices.length : 0;
496
+ if (total === 0) {
497
+ resetRemoveAllButton();
498
+ homebridge.toast.info('There are no devices in the config.', 'Nothing To Remove');
499
+ return;
500
+ }
501
+ if (btn.dataset.confirm !== 'yes') {
502
+ // Removing everything always asks for a second click, since any
503
+ // settings on the entries would be lost
504
+ btn.dataset.confirm = 'yes';
505
+ btn.classList.remove('btn-primary');
506
+ btn.classList.add('btn-danger');
507
+ btn.innerHTML = actionArrow;
508
+ btn.setAttribute('aria-label', 'Confirm removing all devices from the config');
509
+ document.getElementById('removeAllText').innerHTML = 'Any settings on these entries will be lost. Click again to remove all ' + total + (total === 1 ? ' entry.' : ' entries.');
510
+ removeAllConfirmTimer = setTimeout(resetRemoveAllButton, 5000);
511
+ return;
512
+ }
513
+ delete config.devices;
514
+ await homebridge.updatePluginConfig(blocks);
515
+ resetRemoveAllButton();
516
+ setConfigButton(false);
517
+ setHideControl(false);
518
+ homebridge.toast.success(total + ' device entr' + (total === 1 ? 'y' : 'ies') + ' removed - press Save to apply.', 'Removed From Config');
519
+ } catch (err) {
520
+ homebridge.toast.error(err.message, 'Error');
521
+ }
522
+ });
523
+
467
524
  // ===== End device picker =====
468
525
  showIntro = () => {
469
526
  homebridge.disableSaveButton?.();
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "displayName": "Homebridge Ecovacs",
4
4
  "alias": "Deebot",
5
5
  "type": "module",
6
- "version": "8.2.0-beta.1",
6
+ "version": "8.2.0-beta.2",
7
7
  "description": "Homebridge plugin to integrate Ecovacs Deebot/Yeedi devices into HomeKit.",
8
8
  "author": {
9
9
  "name": "bwp91",