@homebridge-plugins/homebridge-august 3.4.0-beta.4 → 3.4.0-beta.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
@@ -5,6 +5,8 @@
5
5
  - feat(matter): expose lock battery via a PowerSource cluster (@zbuc)
6
6
  - feat(ui): add, remove and hide devices from the config via the devices tab
7
7
  - style(ui): standardise the custom ui layout and sync the support tab with the readme
8
+ - feat(ui): add a remove all devices action to the my devices tab
9
+ - fix(schema): declare required fields the standard way so the homebridge ui stops reporting a config validation failure
8
10
 
9
11
  ## v3.3.2 (2026-07-22)
10
12
 
@@ -355,7 +355,6 @@
355
355
  "title": "Device Logging Level Override",
356
356
  "description": "Overrides the plugin logging level for this device only. None turns off all messages from this plugin. Standard shows normal activity, warnings and errors. Debug adds detailed messages, and is what to use when reporting a problem. Default behaves the same as Standard.",
357
357
  "type": "string",
358
- "required": true,
359
358
  "default": "",
360
359
  "oneOf": [
361
360
  {
@@ -422,7 +421,6 @@
422
421
  "title": "Plugin Logging Level",
423
422
  "description": "None turns off all messages from this plugin. Standard shows normal activity, warnings and errors. Debug adds detailed messages, and is what to use when reporting a problem. Default behaves the same as Standard.",
424
423
  "type": "string",
425
- "required": true,
426
424
  "default": "",
427
425
  "oneOf": [
428
426
  {
@@ -468,7 +466,10 @@
468
466
  "description": "If true, Matter support will be disabled and the plugin will use the legacy HAP protocol instead, even when Homebridge Matter is available.",
469
467
  "default": false
470
468
  }
471
- }
469
+ },
470
+ "required": [
471
+ "logging"
472
+ ]
472
473
  }
473
474
  },
474
475
  "required": [
@@ -55,6 +55,17 @@
55
55
  </button>
56
56
  </div>
57
57
  </li>
58
+ <li class="list-group-item">
59
+ <div class="d-flex justify-content-between align-items-center">
60
+ <div class="pr-2">
61
+ <div>Remove All Devices</div>
62
+ <div class="text-muted action-desc" id="removeAllText">Remove every device from the plugin config.</div>
63
+ </div>
64
+ <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">
65
+ <i aria-hidden="true" class="fas fa-arrow-right"></i>
66
+ </button>
67
+ </div>
68
+ </li>
58
69
  <li class="list-group-item">
59
70
  <div class="d-flex justify-content-between align-items-center">
60
71
  <div class="pr-2">
@@ -168,6 +179,7 @@
168
179
  // so staged-but-unsaved edits made in the Settings tab are respected
169
180
  let pickerAccessories = [];
170
181
  let removeConfirmTimer;
182
+ let removeAllConfirmTimer;
171
183
 
172
184
  // The action buttons always show the settings-page arrow; the row text
173
185
  // (and the button's aria-label) says what the arrow will do
@@ -382,6 +394,51 @@
382
394
  homebridge.toast.error(err.message, 'Error');
383
395
  }
384
396
  });
397
+ const resetRemoveAllButton = () => {
398
+ const btn = document.getElementById('removeAllBtn');
399
+ clearTimeout(removeAllConfirmTimer);
400
+ delete btn.dataset.confirm;
401
+ btn.classList.remove('btn-danger');
402
+ btn.classList.add('btn-primary');
403
+ btn.innerHTML = actionArrow;
404
+ btn.setAttribute('aria-label', 'Remove all devices from the config');
405
+ document.getElementById('removeAllText').innerHTML = 'Remove every device from the plugin config.';
406
+ };
407
+
408
+ document.getElementById('removeAllBtn').addEventListener('click', async () => {
409
+ try {
410
+ const btn = document.getElementById('removeAllBtn');
411
+ const blocks = await getConfigBlocks();
412
+ const config = blocks[0];
413
+ const total = config.options && Array.isArray(config.options.devices) ? config.options.devices.length : 0;
414
+ if (total === 0) {
415
+ resetRemoveAllButton();
416
+ homebridge.toast.info('There are no devices in the config.', 'Nothing To Remove');
417
+ return;
418
+ }
419
+ if (btn.dataset.confirm !== 'yes') {
420
+ // Removing everything always asks for a second click, since any
421
+ // settings on the entries would be lost
422
+ btn.dataset.confirm = 'yes';
423
+ btn.classList.remove('btn-primary');
424
+ btn.classList.add('btn-danger');
425
+ btn.innerHTML = actionArrow;
426
+ btn.setAttribute('aria-label', 'Confirm removing all devices from the config');
427
+ document.getElementById('removeAllText').innerHTML = 'Any settings on these entries will be lost. Click again to remove all ' + total + (total === 1 ? ' entry.' : ' entries.');
428
+ removeAllConfirmTimer = setTimeout(resetRemoveAllButton, 5000);
429
+ return;
430
+ }
431
+ delete config.options.devices;
432
+ await homebridge.updatePluginConfig(blocks);
433
+ resetRemoveAllButton();
434
+ setConfigButton(false);
435
+ setHideControl(false);
436
+ homebridge.toast.success(total + ' device entr' + (total === 1 ? 'y' : 'ies') + ' removed - press Save to apply.', 'Removed From Config');
437
+ } catch (err) {
438
+ homebridge.toast.error(err.message, 'Error');
439
+ }
440
+ });
441
+
385
442
  // ===== End device picker =====
386
443
  showIntro = () => {
387
444
  const introLink = document.getElementById('introLink');
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@homebridge-plugins/homebridge-august",
3
3
  "displayName": "August",
4
4
  "type": "module",
5
- "version": "3.4.0-beta.4",
5
+ "version": "3.4.0-beta.6",
6
6
  "description": "The August plugin allows you to access your August & Yale device(s) from HomeKit.",
7
7
  "author": {
8
8
  "name": "bwp91",