@homebridge-plugins/homebridge-govee 11.32.0-beta.1 → 11.32.0-beta.2

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
@@ -9,6 +9,7 @@ All notable changes to `@homebridge-plugins/homebridge-govee` will be documented
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
11
  - feat(ui): hide or show a device in homekit from the my devices tab
12
+ - style(ui): present the device config actions as a settings-style list
12
13
 
13
14
  ## v11.31.0 (2026-07-24)
14
15
 
@@ -17,6 +17,15 @@
17
17
  color: #eeeeee !important;
18
18
  font-weight: 500 !important;
19
19
  }
20
+
21
+ .list-group-item {
22
+ background-color: #333333;
23
+ border-color: #444444;
24
+ color: #eeeeee;
25
+ }
26
+ }
27
+ .min-w-50 {
28
+ min-width: 50px;
20
29
  }
21
30
  select {
22
31
  background-image:
@@ -77,6 +86,26 @@
77
86
  <select class="form-control" id="deviceSelect"></select>
78
87
  </div>
79
88
  </form>
89
+ <ul class="list-group mt-2 mb-3 mx-0" id="configActionList" style="display: none;">
90
+ <li class="list-group-item">
91
+ <div class="d-flex justify-content-between align-items-center">
92
+ <span class="pr-2">Adds all devices to the config.</span>
93
+ <button type="button" class="btn btn-primary m-0 ml-3 py-1 min-w-50" id="addAllBtn">Add All</button>
94
+ </div>
95
+ </li>
96
+ <li class="list-group-item">
97
+ <div class="d-flex justify-content-between align-items-center">
98
+ <span class="pr-2" id="deviceConfigText">Adds this device to the config.</span>
99
+ <button type="button" class="btn btn-primary m-0 ml-3 py-1 min-w-50" id="deviceConfigBtn">Add</button>
100
+ </div>
101
+ </li>
102
+ <li class="list-group-item">
103
+ <div class="d-flex justify-content-between align-items-center">
104
+ <span class="pr-2" id="hideDeviceText">Hide this device from HomeKit.</span>
105
+ <button type="button" class="btn btn-primary m-0 ml-3 py-1 min-w-50" id="hideDeviceBtn">Hide</button>
106
+ </div>
107
+ </li>
108
+ </ul>
80
109
  <table class="table w-100 mt-3" id="deviceTable" style="display: none;">
81
110
  <thead>
82
111
  <tr class="table-active">
@@ -161,24 +190,11 @@
161
190
  <th scope="row">Humidity Range</th>
162
191
  <td id="humi_range"></td>
163
192
  </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>
173
193
  <tr>
174
194
  <td colspan="2" style="text-align: center" id="image"></td>
175
195
  </tr>
176
196
  </tbody>
177
197
  </table>
178
- <div id="configBtnRow" class="text-center mt-2 mb-3" style="display: none;">
179
- <button type="button" class="btn btn-primary" id="deviceConfigBtn">Add To Config</button>
180
- <button type="button" class="btn btn-secondary" id="addAllBtn">Add All To Config</button>
181
- </div>
182
198
  </div>
183
199
  </div>
184
200
  <div id="pageSupport" class="mt-4" style="display: none;">
@@ -365,8 +381,13 @@
365
381
  return null
366
382
  }
367
383
 
368
- const setHideCheckbox = hidden => {
369
- document.getElementById('hideDeviceCheck').checked = !!hidden
384
+ const setHideControl = hidden => {
385
+ const btn = document.getElementById('hideDeviceBtn')
386
+ btn.dataset.hidden = hidden ? 'yes' : 'no'
387
+ btn.innerHTML = hidden ? 'Show' : 'Hide'
388
+ document.getElementById('hideDeviceText').innerHTML = hidden
389
+ ? 'Show this device in HomeKit.'
390
+ : 'Hide this device from HomeKit.'
370
391
  }
371
392
 
372
393
  const setConfigButton = inConfig => {
@@ -376,7 +397,10 @@
376
397
  btn.dataset.state = inConfig ? 'remove' : 'add'
377
398
  btn.classList.remove('btn-danger')
378
399
  btn.classList.add('btn-primary')
379
- btn.innerHTML = inConfig ? 'Remove From Config' : 'Add To Config'
400
+ btn.innerHTML = inConfig ? 'Remove' : 'Add'
401
+ document.getElementById('deviceConfigText').innerHTML = inConfig
402
+ ? 'Removes this device from the config.'
403
+ : 'Adds this device to the config.'
380
404
  }
381
405
 
382
406
  const addDeviceToConfig = (config, acc) => {
@@ -405,19 +429,19 @@
405
429
  // re-check and never add a duplicate - just correct the button
406
430
  if (found) {
407
431
  setConfigButton(true)
408
- setHideCheckbox(!!config[found.key][found.index].ignoreDevice)
432
+ setHideControl(!!config[found.key][found.index].ignoreDevice)
409
433
  homebridge.toast.info(acc.displayName + ' is already in the config.', 'Not Added')
410
434
  return
411
435
  }
412
436
  addDeviceToConfig(config, acc)
413
437
  await homebridge.updatePluginConfig(blocks)
414
438
  setConfigButton(true)
415
- setHideCheckbox(false)
439
+ setHideControl(false)
416
440
  homebridge.toast.success(acc.displayName + ' added - press Save to apply.', 'Added To Config')
417
441
  } else {
418
442
  if (!found) {
419
443
  setConfigButton(false)
420
- setHideCheckbox(false)
444
+ setHideControl(false)
421
445
  homebridge.toast.info(acc.displayName + ' is not in the config.', 'Not Removed')
422
446
  return
423
447
  }
@@ -429,7 +453,8 @@
429
453
  btn.dataset.confirm = 'yes'
430
454
  btn.classList.remove('btn-primary')
431
455
  btn.classList.add('btn-danger')
432
- btn.innerHTML = 'Click Again To Remove (entry has settings)'
456
+ btn.innerHTML = 'Confirm'
457
+ document.getElementById('deviceConfigText').innerHTML = 'This entry has extra settings which will be lost - click again to remove it.'
433
458
  removeConfirmTimer = setTimeout(() => setConfigButton(true), 5000)
434
459
  return
435
460
  }
@@ -439,7 +464,7 @@
439
464
  }
440
465
  await homebridge.updatePluginConfig(blocks)
441
466
  setConfigButton(false)
442
- setHideCheckbox(false)
467
+ setHideControl(false)
443
468
  homebridge.toast.success(acc.displayName + ' removed - press Save to apply.', 'Removed From Config')
444
469
  }
445
470
  } catch (err) {
@@ -447,7 +472,7 @@
447
472
  }
448
473
  })
449
474
 
450
- document.getElementById('hideDeviceCheck').addEventListener('change', async (e) => {
475
+ document.getElementById('hideDeviceBtn').addEventListener('click', async () => {
451
476
  try {
452
477
  const selectedId = document.getElementById('deviceSelect').value
453
478
  const acc = pickerAccessories.find(x => x.context.gvDeviceId === selectedId)
@@ -457,7 +482,8 @@
457
482
  const blocks = await getConfigBlocks()
458
483
  const config = blocks[0]
459
484
  let found = findInConfig(config, selectedId)
460
- if (e.target.checked) {
485
+ const currentlyHidden = document.getElementById('hideDeviceBtn').dataset.hidden === 'yes'
486
+ if (!currentlyHidden) {
461
487
  // Hiding needs a config entry to carry the flag, so create one if
462
488
  // the device is not in the config yet
463
489
  if (!found) {
@@ -467,6 +493,7 @@
467
493
  config[found.key][found.index].ignoreDevice = true
468
494
  await homebridge.updatePluginConfig(blocks)
469
495
  setConfigButton(true)
496
+ setHideControl(true)
470
497
  homebridge.toast.success(acc.displayName + ' will be hidden from HomeKit - press Save to apply.', 'Device Hidden')
471
498
  } else {
472
499
  if (found) {
@@ -476,6 +503,7 @@
476
503
  await homebridge.updatePluginConfig(blocks)
477
504
  }
478
505
  setConfigButton(!!found)
506
+ setHideControl(false)
479
507
  homebridge.toast.success(acc.displayName + ' will be shown in HomeKit - press Save to apply.', 'Device Unhidden')
480
508
  }
481
509
  } catch (err) {
@@ -511,7 +539,7 @@
511
539
  const nowFound = findInConfig(config, selectedId)
512
540
  setConfigButton(!!nowFound)
513
541
  if (nowFound) {
514
- setHideCheckbox(!!config[nowFound.key][nowFound.index].ignoreDevice)
542
+ setHideControl(!!config[nowFound.key][nowFound.index].ignoreDevice)
515
543
  }
516
544
  }
517
545
  } catch (err) {
@@ -691,8 +719,8 @@
691
719
  const configBlocks = await getConfigBlocks()
692
720
  const configEntry = findInConfig(configBlocks[0], context.gvDeviceId)
693
721
  setConfigButton(!!configEntry)
694
- setHideCheckbox(!!(configEntry && configBlocks[0][configEntry.key][configEntry.index].ignoreDevice))
695
- document.getElementById('configBtnRow').style.display = 'block'
722
+ setHideControl(!!(configEntry && configBlocks[0][configEntry.key][configEntry.index].ignoreDevice))
723
+ document.getElementById('configActionList').style.display = 'block'
696
724
  homebridge.hideSpinner()
697
725
  }
698
726
  deviceSelect.addEventListener('change', event => showDeviceInfo(event.target.value))
@@ -703,7 +731,7 @@
703
731
  option.text = 'No Devices'
704
732
  deviceSelect.add(option)
705
733
  deviceSelect.disabled = true
706
- document.getElementById('configBtnRow').style.display = 'none'
734
+ document.getElementById('configActionList').style.display = 'none'
707
735
  }
708
736
  homebridge.hideSpinner()
709
737
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@homebridge-plugins/homebridge-govee",
3
3
  "alias": "Govee",
4
4
  "type": "module",
5
- "version": "11.32.0-beta.1",
5
+ "version": "11.32.0-beta.2",
6
6
  "description": "Homebridge plugin to integrate Govee devices into HomeKit.",
7
7
  "author": {
8
8
  "name": "bwp91",