@homebridge-plugins/homebridge-august 3.4.0-beta.4 → 3.4.0-beta.5
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 +1 -0
- package/dist/homebridge-ui/public/index.html +57 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
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
|
|
8
9
|
|
|
9
10
|
## v3.3.2 (2026-07-22)
|
|
10
11
|
|
|
@@ -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.
|
|
5
|
+
"version": "3.4.0-beta.5",
|
|
6
6
|
"description": "The August plugin allows you to access your August & Yale device(s) from HomeKit.",
|
|
7
7
|
"author": {
|
|
8
8
|
"name": "bwp91",
|