@homebridge-plugins/homebridge-govee 11.32.0-beta.1 → 11.32.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
@@ -9,6 +9,8 @@ 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
13
+ - style(ui): polish the action list - consistent spacing, arrow buttons, bold emphasis
12
14
 
13
15
  ## v11.31.0 (2026-07-24)
14
16
 
@@ -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:
@@ -73,11 +82,37 @@
73
82
  </div>
74
83
  <div id="deviceInfo">
75
84
  <form>
76
- <div class="form-group">
85
+ <div class="form-group mb-0">
77
86
  <select class="form-control" id="deviceSelect"></select>
78
87
  </div>
79
88
  </form>
80
- <table class="table w-100 mt-3" id="deviceTable" style="display: none;">
89
+ <ul class="list-group mt-4 mb-4 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 <strong>all</strong> devices to the config</span>
93
+ <button type="button" class="btn btn-primary m-0 ml-3 py-1 min-w-50" id="addAllBtn" aria-label="Add all devices to the config">
94
+ <i aria-hidden="true" class="fas fa-arrow-right"></i>
95
+ </button>
96
+ </div>
97
+ </li>
98
+ <li class="list-group-item">
99
+ <div class="d-flex justify-content-between align-items-center">
100
+ <span class="pr-2" id="deviceConfigText">Adds <strong>this</strong> device to the config</span>
101
+ <button type="button" class="btn btn-primary m-0 ml-3 py-1 min-w-50" id="deviceConfigBtn" aria-label="Add this device to the config">
102
+ <i aria-hidden="true" class="fas fa-arrow-right"></i>
103
+ </button>
104
+ </div>
105
+ </li>
106
+ <li class="list-group-item">
107
+ <div class="d-flex justify-content-between align-items-center">
108
+ <span class="pr-2" id="hideDeviceText">Hide <strong>this</strong> device from HomeKit</span>
109
+ <button type="button" class="btn btn-primary m-0 ml-3 py-1 min-w-50" id="hideDeviceBtn" aria-label="Hide this device from HomeKit">
110
+ <i aria-hidden="true" class="fas fa-arrow-right"></i>
111
+ </button>
112
+ </div>
113
+ </li>
114
+ </ul>
115
+ <table class="table w-100 mt-0" id="deviceTable" style="display: none;">
81
116
  <thead>
82
117
  <tr class="table-active">
83
118
  <th scope="col" style="width: 40%;">Device Name</th>
@@ -161,24 +196,11 @@
161
196
  <th scope="row">Humidity Range</th>
162
197
  <td id="humi_range"></td>
163
198
  </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
199
  <tr>
174
200
  <td colspan="2" style="text-align: center" id="image"></td>
175
201
  </tr>
176
202
  </tbody>
177
203
  </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
204
  </div>
183
205
  </div>
184
206
  <div id="pageSupport" class="mt-4" style="display: none;">
@@ -365,8 +387,18 @@
365
387
  return null
366
388
  }
367
389
 
368
- const setHideCheckbox = hidden => {
369
- document.getElementById('hideDeviceCheck').checked = !!hidden
390
+ // The action buttons always show the settings-page arrow; the row text
391
+ // (and the button's aria-label) says what the arrow will do
392
+ const actionArrow = '<i aria-hidden="true" class="fas fa-arrow-right"></i>'
393
+
394
+ const setHideControl = hidden => {
395
+ const btn = document.getElementById('hideDeviceBtn')
396
+ btn.dataset.hidden = hidden ? 'yes' : 'no'
397
+ btn.innerHTML = actionArrow
398
+ btn.setAttribute('aria-label', hidden ? 'Show this device in HomeKit' : 'Hide this device from HomeKit')
399
+ document.getElementById('hideDeviceText').innerHTML = hidden
400
+ ? 'Show <strong>this</strong> device in HomeKit'
401
+ : 'Hide <strong>this</strong> device from HomeKit'
370
402
  }
371
403
 
372
404
  const setConfigButton = inConfig => {
@@ -376,7 +408,11 @@
376
408
  btn.dataset.state = inConfig ? 'remove' : 'add'
377
409
  btn.classList.remove('btn-danger')
378
410
  btn.classList.add('btn-primary')
379
- btn.innerHTML = inConfig ? 'Remove From Config' : 'Add To Config'
411
+ btn.innerHTML = actionArrow
412
+ btn.setAttribute('aria-label', inConfig ? 'Remove this device from the config' : 'Add this device to the config')
413
+ document.getElementById('deviceConfigText').innerHTML = inConfig
414
+ ? 'Removes <strong>this</strong> device from the config'
415
+ : 'Adds <strong>this</strong> device to the config'
380
416
  }
381
417
 
382
418
  const addDeviceToConfig = (config, acc) => {
@@ -405,19 +441,19 @@
405
441
  // re-check and never add a duplicate - just correct the button
406
442
  if (found) {
407
443
  setConfigButton(true)
408
- setHideCheckbox(!!config[found.key][found.index].ignoreDevice)
444
+ setHideControl(!!config[found.key][found.index].ignoreDevice)
409
445
  homebridge.toast.info(acc.displayName + ' is already in the config.', 'Not Added')
410
446
  return
411
447
  }
412
448
  addDeviceToConfig(config, acc)
413
449
  await homebridge.updatePluginConfig(blocks)
414
450
  setConfigButton(true)
415
- setHideCheckbox(false)
451
+ setHideControl(false)
416
452
  homebridge.toast.success(acc.displayName + ' added - press Save to apply.', 'Added To Config')
417
453
  } else {
418
454
  if (!found) {
419
455
  setConfigButton(false)
420
- setHideCheckbox(false)
456
+ setHideControl(false)
421
457
  homebridge.toast.info(acc.displayName + ' is not in the config.', 'Not Removed')
422
458
  return
423
459
  }
@@ -429,7 +465,9 @@
429
465
  btn.dataset.confirm = 'yes'
430
466
  btn.classList.remove('btn-primary')
431
467
  btn.classList.add('btn-danger')
432
- btn.innerHTML = 'Click Again To Remove (entry has settings)'
468
+ btn.innerHTML = actionArrow
469
+ btn.setAttribute('aria-label', 'Confirm removing this device from the config')
470
+ document.getElementById('deviceConfigText').innerHTML = 'This entry has extra settings which will be lost - click again to remove it'
433
471
  removeConfirmTimer = setTimeout(() => setConfigButton(true), 5000)
434
472
  return
435
473
  }
@@ -439,7 +477,7 @@
439
477
  }
440
478
  await homebridge.updatePluginConfig(blocks)
441
479
  setConfigButton(false)
442
- setHideCheckbox(false)
480
+ setHideControl(false)
443
481
  homebridge.toast.success(acc.displayName + ' removed - press Save to apply.', 'Removed From Config')
444
482
  }
445
483
  } catch (err) {
@@ -447,7 +485,7 @@
447
485
  }
448
486
  })
449
487
 
450
- document.getElementById('hideDeviceCheck').addEventListener('change', async (e) => {
488
+ document.getElementById('hideDeviceBtn').addEventListener('click', async () => {
451
489
  try {
452
490
  const selectedId = document.getElementById('deviceSelect').value
453
491
  const acc = pickerAccessories.find(x => x.context.gvDeviceId === selectedId)
@@ -457,7 +495,8 @@
457
495
  const blocks = await getConfigBlocks()
458
496
  const config = blocks[0]
459
497
  let found = findInConfig(config, selectedId)
460
- if (e.target.checked) {
498
+ const currentlyHidden = document.getElementById('hideDeviceBtn').dataset.hidden === 'yes'
499
+ if (!currentlyHidden) {
461
500
  // Hiding needs a config entry to carry the flag, so create one if
462
501
  // the device is not in the config yet
463
502
  if (!found) {
@@ -467,6 +506,7 @@
467
506
  config[found.key][found.index].ignoreDevice = true
468
507
  await homebridge.updatePluginConfig(blocks)
469
508
  setConfigButton(true)
509
+ setHideControl(true)
470
510
  homebridge.toast.success(acc.displayName + ' will be hidden from HomeKit - press Save to apply.', 'Device Hidden')
471
511
  } else {
472
512
  if (found) {
@@ -476,6 +516,7 @@
476
516
  await homebridge.updatePluginConfig(blocks)
477
517
  }
478
518
  setConfigButton(!!found)
519
+ setHideControl(false)
479
520
  homebridge.toast.success(acc.displayName + ' will be shown in HomeKit - press Save to apply.', 'Device Unhidden')
480
521
  }
481
522
  } catch (err) {
@@ -511,7 +552,7 @@
511
552
  const nowFound = findInConfig(config, selectedId)
512
553
  setConfigButton(!!nowFound)
513
554
  if (nowFound) {
514
- setHideCheckbox(!!config[nowFound.key][nowFound.index].ignoreDevice)
555
+ setHideControl(!!config[nowFound.key][nowFound.index].ignoreDevice)
515
556
  }
516
557
  }
517
558
  } catch (err) {
@@ -691,8 +732,8 @@
691
732
  const configBlocks = await getConfigBlocks()
692
733
  const configEntry = findInConfig(configBlocks[0], context.gvDeviceId)
693
734
  setConfigButton(!!configEntry)
694
- setHideCheckbox(!!(configEntry && configBlocks[0][configEntry.key][configEntry.index].ignoreDevice))
695
- document.getElementById('configBtnRow').style.display = 'block'
735
+ setHideControl(!!(configEntry && configBlocks[0][configEntry.key][configEntry.index].ignoreDevice))
736
+ document.getElementById('configActionList').style.display = 'block'
696
737
  homebridge.hideSpinner()
697
738
  }
698
739
  deviceSelect.addEventListener('change', event => showDeviceInfo(event.target.value))
@@ -703,7 +744,7 @@
703
744
  option.text = 'No Devices'
704
745
  deviceSelect.add(option)
705
746
  deviceSelect.disabled = true
706
- document.getElementById('configBtnRow').style.display = 'none'
747
+ document.getElementById('configActionList').style.display = 'none'
707
748
  }
708
749
  homebridge.hideSpinner()
709
750
  }
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.3",
6
6
  "description": "Homebridge plugin to integrate Govee devices into HomeKit.",
7
7
  "author": {
8
8
  "name": "bwp91",