@homebridge-plugins/homebridge-wemo 7.6.0-beta.1 → 7.6.0-beta.3

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,8 @@ All notable changes to `@homebridge-plugins/homebridge-wemo` will be documented
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
12
+ - chore: declare the supports-hap transport keyword for the homebridge ui
11
13
 
12
14
  ## v7.5.3 (2026-07-18)
13
15
 
@@ -92,6 +92,17 @@
92
92
  </button>
93
93
  </div>
94
94
  </li>
95
+ <li class="list-group-item">
96
+ <div class="d-flex justify-content-between align-items-center">
97
+ <div class="pr-2">
98
+ <div>Remove All Devices</div>
99
+ <div class="text-muted action-desc" id="removeAllText">Remove every device from the plugin config.</div>
100
+ </div>
101
+ <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">
102
+ <i aria-hidden="true" class="fas fa-arrow-right"></i>
103
+ </button>
104
+ </div>
105
+ </li>
95
106
  <li class="list-group-item">
96
107
  <div class="d-flex justify-content-between align-items-center">
97
108
  <div class="pr-2">
@@ -254,6 +265,7 @@
254
265
  }
255
266
  let pickerAccessories = []
256
267
  let removeConfirmTimer
268
+ let removeAllConfirmTimer
257
269
 
258
270
  // The action buttons always show the settings-page arrow; the row text
259
271
  // (and the button's aria-label) says what the arrow will do
@@ -460,6 +472,58 @@
460
472
  homebridge.toast.error(err.message, 'Error')
461
473
  }
462
474
  })
475
+ const resetRemoveAllButton = () => {
476
+ const btn = document.getElementById('removeAllBtn')
477
+ clearTimeout(removeAllConfirmTimer)
478
+ delete btn.dataset.confirm
479
+ btn.classList.remove('btn-danger')
480
+ btn.classList.add('btn-primary')
481
+ btn.innerHTML = actionArrow
482
+ btn.setAttribute('aria-label', 'Remove all devices from the config')
483
+ document.getElementById('removeAllText').innerHTML = 'Remove every device from the plugin config.'
484
+ }
485
+
486
+ document.getElementById('removeAllBtn').addEventListener('click', async () => {
487
+ try {
488
+ const btn = document.getElementById('removeAllBtn')
489
+ const blocks = await getConfigBlocks()
490
+ const config = blocks[0]
491
+ let total = 0
492
+ deviceArrays.forEach((key) => {
493
+ if (Array.isArray(config[key])) {
494
+ total += config[key].length
495
+ }
496
+ })
497
+ if (total === 0) {
498
+ resetRemoveAllButton()
499
+ homebridge.toast.info('There are no devices in the config.', 'Nothing To Remove')
500
+ return
501
+ }
502
+ if (btn.dataset.confirm !== 'yes') {
503
+ // Removing everything always asks for a second click, since any
504
+ // settings on the entries would be lost
505
+ btn.dataset.confirm = 'yes'
506
+ btn.classList.remove('btn-primary')
507
+ btn.classList.add('btn-danger')
508
+ btn.innerHTML = actionArrow
509
+ btn.setAttribute('aria-label', 'Confirm removing all devices from the config')
510
+ document.getElementById('removeAllText').innerHTML = 'Any settings on these entries will be lost. Click again to remove all ' + total + (total === 1 ? ' entry.' : ' entries.')
511
+ removeAllConfirmTimer = setTimeout(resetRemoveAllButton, 5000)
512
+ return
513
+ }
514
+ deviceArrays.forEach((key) => {
515
+ delete config[key]
516
+ })
517
+ await homebridge.updatePluginConfig(blocks)
518
+ resetRemoveAllButton()
519
+ setConfigButton(false)
520
+ setHideControl(false)
521
+ homebridge.toast.success(total + ' device entr' + (total === 1 ? 'y' : 'ies') + ' removed - press Save to apply.', 'Removed From Config')
522
+ } catch (err) {
523
+ homebridge.toast.error(err.message, 'Error')
524
+ }
525
+ })
526
+
463
527
  // ===== End device picker =====
464
528
 
465
529
  showIntro = () => {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@homebridge-plugins/homebridge-wemo",
3
3
  "alias": "Wemo",
4
4
  "type": "module",
5
- "version": "7.6.0-beta.1",
5
+ "version": "7.6.0-beta.3",
6
6
  "description": "Homebridge plugin to integrate Wemo devices into HomeKit.",
7
7
  "author": {
8
8
  "name": "bwp91",
@@ -38,6 +38,7 @@
38
38
  "keywords": [
39
39
  "homebridge",
40
40
  "homebridge-plugin",
41
+ "supports-hap",
41
42
  "hoobs",
42
43
  "hoobs-plugin",
43
44
  "homekit",