@homebridge-plugins/homebridge-meross 10.17.0-beta.1 → 10.17.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-meross` will be documente
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
  ## v10.16.5 (2026-07-18)
13
15
 
@@ -102,6 +102,17 @@
102
102
  </button>
103
103
  </div>
104
104
  </li>
105
+ <li class="list-group-item">
106
+ <div class="d-flex justify-content-between align-items-center">
107
+ <div class="pr-2">
108
+ <div>Remove All Devices</div>
109
+ <div class="text-muted action-desc" id="removeAllText">Remove every device from the plugin config.</div>
110
+ </div>
111
+ <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">
112
+ <i aria-hidden="true" class="fas fa-arrow-right"></i>
113
+ </button>
114
+ </div>
115
+ </li>
105
116
  <li class="list-group-item">
106
117
  <div class="d-flex justify-content-between align-items-center">
107
118
  <div class="pr-2">
@@ -249,6 +260,7 @@
249
260
  ]
250
261
  let pickerAccessories = []
251
262
  let removeConfirmTimer
263
+ let removeAllConfirmTimer
252
264
 
253
265
  // The action buttons always show the settings-page arrow; the row text
254
266
  // (and the button's aria-label) says what the arrow will do
@@ -470,6 +482,58 @@
470
482
  homebridge.toast.error(err.message, 'Error')
471
483
  }
472
484
  })
485
+ const resetRemoveAllButton = () => {
486
+ const btn = document.getElementById('removeAllBtn')
487
+ clearTimeout(removeAllConfirmTimer)
488
+ delete btn.dataset.confirm
489
+ btn.classList.remove('btn-danger')
490
+ btn.classList.add('btn-primary')
491
+ btn.innerHTML = actionArrow
492
+ btn.setAttribute('aria-label', 'Remove all devices from the config')
493
+ document.getElementById('removeAllText').innerHTML = 'Remove every device from the plugin config.'
494
+ }
495
+
496
+ document.getElementById('removeAllBtn').addEventListener('click', async () => {
497
+ try {
498
+ const btn = document.getElementById('removeAllBtn')
499
+ const blocks = await getConfigBlocks()
500
+ const config = blocks[0]
501
+ let total = 0
502
+ deviceArrays.forEach((key) => {
503
+ if (Array.isArray(config[key])) {
504
+ total += config[key].length
505
+ }
506
+ })
507
+ if (total === 0) {
508
+ resetRemoveAllButton()
509
+ homebridge.toast.info('There are no devices in the config.', 'Nothing To Remove')
510
+ return
511
+ }
512
+ if (btn.dataset.confirm !== 'yes') {
513
+ // Removing everything always asks for a second click, since any
514
+ // settings on the entries would be lost
515
+ btn.dataset.confirm = 'yes'
516
+ btn.classList.remove('btn-primary')
517
+ btn.classList.add('btn-danger')
518
+ btn.innerHTML = actionArrow
519
+ btn.setAttribute('aria-label', 'Confirm removing all devices from the config')
520
+ document.getElementById('removeAllText').innerHTML = 'Any settings on these entries will be lost. Click again to remove all ' + total + (total === 1 ? ' entry.' : ' entries.')
521
+ removeAllConfirmTimer = setTimeout(resetRemoveAllButton, 5000)
522
+ return
523
+ }
524
+ deviceArrays.forEach((key) => {
525
+ delete config[key]
526
+ })
527
+ await homebridge.updatePluginConfig(blocks)
528
+ resetRemoveAllButton()
529
+ setConfigButton(false)
530
+ setHideControl(false)
531
+ homebridge.toast.success(total + ' device entr' + (total === 1 ? 'y' : 'ies') + ' removed - press Save to apply.', 'Removed From Config')
532
+ } catch (err) {
533
+ homebridge.toast.error(err.message, 'Error')
534
+ }
535
+ })
536
+
473
537
  // ===== End device picker =====
474
538
 
475
539
  showIntro = () => {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@homebridge-plugins/homebridge-meross",
3
3
  "alias": "Meross",
4
4
  "type": "module",
5
- "version": "10.17.0-beta.1",
5
+ "version": "10.17.0-beta.3",
6
6
  "description": "Homebridge plugin to integrate Meross 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
  "homebridge-meross",
42
43
  "hoobs",
43
44
  "hoobs-plugin",