@homebridge-plugins/homebridge-govee 11.32.0-beta.0 → 11.32.0-beta.1
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/lib/homebridge-ui/public/index.html +61 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,7 @@ All notable changes to `@homebridge-plugins/homebridge-govee` will be documented
|
|
|
8
8
|
|
|
9
9
|
- chore(github): use the shared homebridge action to deprecate past pre-releases
|
|
10
10
|
- feat(ui): add and remove devices from the config via the my devices tab (#1323)
|
|
11
|
+
- feat(ui): hide or show a device in homekit from the my devices tab
|
|
11
12
|
|
|
12
13
|
## v11.31.0 (2026-07-24)
|
|
13
14
|
|
|
@@ -161,6 +161,15 @@
|
|
|
161
161
|
<th scope="row">Humidity Range</th>
|
|
162
162
|
<td id="humi_range"></td>
|
|
163
163
|
</tr>
|
|
164
|
+
<tr>
|
|
165
|
+
<th scope="row">Hide From HomeKit</th>
|
|
166
|
+
<td>
|
|
167
|
+
<div class="custom-control custom-checkbox">
|
|
168
|
+
<input type="checkbox" class="custom-control-input" id="hideDeviceCheck">
|
|
169
|
+
<label class="custom-control-label" for="hideDeviceCheck">Hide this device from HomeKit</label>
|
|
170
|
+
</div>
|
|
171
|
+
</td>
|
|
172
|
+
</tr>
|
|
164
173
|
<tr>
|
|
165
174
|
<td colspan="2" style="text-align: center" id="image"></td>
|
|
166
175
|
</tr>
|
|
@@ -356,6 +365,10 @@
|
|
|
356
365
|
return null
|
|
357
366
|
}
|
|
358
367
|
|
|
368
|
+
const setHideCheckbox = hidden => {
|
|
369
|
+
document.getElementById('hideDeviceCheck').checked = !!hidden
|
|
370
|
+
}
|
|
371
|
+
|
|
359
372
|
const setConfigButton = inConfig => {
|
|
360
373
|
const btn = document.getElementById('deviceConfigBtn')
|
|
361
374
|
clearTimeout(removeConfirmTimer)
|
|
@@ -392,16 +405,19 @@
|
|
|
392
405
|
// re-check and never add a duplicate - just correct the button
|
|
393
406
|
if (found) {
|
|
394
407
|
setConfigButton(true)
|
|
408
|
+
setHideCheckbox(!!config[found.key][found.index].ignoreDevice)
|
|
395
409
|
homebridge.toast.info(acc.displayName + ' is already in the config.', 'Not Added')
|
|
396
410
|
return
|
|
397
411
|
}
|
|
398
412
|
addDeviceToConfig(config, acc)
|
|
399
413
|
await homebridge.updatePluginConfig(blocks)
|
|
400
414
|
setConfigButton(true)
|
|
415
|
+
setHideCheckbox(false)
|
|
401
416
|
homebridge.toast.success(acc.displayName + ' added - press Save to apply.', 'Added To Config')
|
|
402
417
|
} else {
|
|
403
418
|
if (!found) {
|
|
404
419
|
setConfigButton(false)
|
|
420
|
+
setHideCheckbox(false)
|
|
405
421
|
homebridge.toast.info(acc.displayName + ' is not in the config.', 'Not Removed')
|
|
406
422
|
return
|
|
407
423
|
}
|
|
@@ -423,6 +439,7 @@
|
|
|
423
439
|
}
|
|
424
440
|
await homebridge.updatePluginConfig(blocks)
|
|
425
441
|
setConfigButton(false)
|
|
442
|
+
setHideCheckbox(false)
|
|
426
443
|
homebridge.toast.success(acc.displayName + ' removed - press Save to apply.', 'Removed From Config')
|
|
427
444
|
}
|
|
428
445
|
} catch (err) {
|
|
@@ -430,6 +447,42 @@
|
|
|
430
447
|
}
|
|
431
448
|
})
|
|
432
449
|
|
|
450
|
+
document.getElementById('hideDeviceCheck').addEventListener('change', async (e) => {
|
|
451
|
+
try {
|
|
452
|
+
const selectedId = document.getElementById('deviceSelect').value
|
|
453
|
+
const acc = pickerAccessories.find(x => x.context.gvDeviceId === selectedId)
|
|
454
|
+
if (!acc) {
|
|
455
|
+
return
|
|
456
|
+
}
|
|
457
|
+
const blocks = await getConfigBlocks()
|
|
458
|
+
const config = blocks[0]
|
|
459
|
+
let found = findInConfig(config, selectedId)
|
|
460
|
+
if (e.target.checked) {
|
|
461
|
+
// Hiding needs a config entry to carry the flag, so create one if
|
|
462
|
+
// the device is not in the config yet
|
|
463
|
+
if (!found) {
|
|
464
|
+
addDeviceToConfig(config, acc)
|
|
465
|
+
found = findInConfig(config, selectedId)
|
|
466
|
+
}
|
|
467
|
+
config[found.key][found.index].ignoreDevice = true
|
|
468
|
+
await homebridge.updatePluginConfig(blocks)
|
|
469
|
+
setConfigButton(true)
|
|
470
|
+
homebridge.toast.success(acc.displayName + ' will be hidden from HomeKit - press Save to apply.', 'Device Hidden')
|
|
471
|
+
} else {
|
|
472
|
+
if (found) {
|
|
473
|
+
// Drop the flag rather than storing ignoreDevice false, to keep
|
|
474
|
+
// the entry clean
|
|
475
|
+
delete config[found.key][found.index].ignoreDevice
|
|
476
|
+
await homebridge.updatePluginConfig(blocks)
|
|
477
|
+
}
|
|
478
|
+
setConfigButton(!!found)
|
|
479
|
+
homebridge.toast.success(acc.displayName + ' will be shown in HomeKit - press Save to apply.', 'Device Unhidden')
|
|
480
|
+
}
|
|
481
|
+
} catch (err) {
|
|
482
|
+
homebridge.toast.error(err.message, 'Error')
|
|
483
|
+
}
|
|
484
|
+
})
|
|
485
|
+
|
|
433
486
|
document.getElementById('addAllBtn').addEventListener('click', async () => {
|
|
434
487
|
try {
|
|
435
488
|
const blocks = await getConfigBlocks()
|
|
@@ -455,7 +508,11 @@
|
|
|
455
508
|
}
|
|
456
509
|
const selectedId = document.getElementById('deviceSelect').value
|
|
457
510
|
if (selectedId) {
|
|
458
|
-
|
|
511
|
+
const nowFound = findInConfig(config, selectedId)
|
|
512
|
+
setConfigButton(!!nowFound)
|
|
513
|
+
if (nowFound) {
|
|
514
|
+
setHideCheckbox(!!config[nowFound.key][nowFound.index].ignoreDevice)
|
|
515
|
+
}
|
|
459
516
|
}
|
|
460
517
|
} catch (err) {
|
|
461
518
|
homebridge.toast.error(err.message, 'Error')
|
|
@@ -632,7 +689,9 @@
|
|
|
632
689
|
: ''
|
|
633
690
|
document.getElementById('deviceTable').style.display = 'inline-table'
|
|
634
691
|
const configBlocks = await getConfigBlocks()
|
|
635
|
-
|
|
692
|
+
const configEntry = findInConfig(configBlocks[0], context.gvDeviceId)
|
|
693
|
+
setConfigButton(!!configEntry)
|
|
694
|
+
setHideCheckbox(!!(configEntry && configBlocks[0][configEntry.key][configEntry.index].ignoreDevice))
|
|
636
695
|
document.getElementById('configBtnRow').style.display = 'block'
|
|
637
696
|
homebridge.hideSpinner()
|
|
638
697
|
}
|
package/package.json
CHANGED