@homebridge-plugins/homebridge-govee 11.34.2-beta.10 → 11.34.2-beta.12
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/utils/device-context.js +33 -3
- package/lib/utils/lang-en.js +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -24,6 +24,7 @@ All notable changes to `@homebridge-plugins/homebridge-govee` will be documented
|
|
|
24
24
|
- feat: show whether the kettle is heating, keeping warm or idle (#1337)
|
|
25
25
|
- fix: give the H5106 a battery service, so its low battery setting does something
|
|
26
26
|
- fix: stop a light's broadcast being mistaken for an h5101 sensor reading
|
|
27
|
+
- fix: follow a device renamed in the govee app, instead of keeping its first name forever (#1344)
|
|
27
28
|
|
|
28
29
|
## v11.34.1 (2026-08-06)
|
|
29
30
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import platformConsts from './constants.js'
|
|
2
2
|
import { getDeviceCapabilities } from './device-capabilities.js'
|
|
3
3
|
import { hasProperty } from './functions.js'
|
|
4
|
+
import platformLang from './lang-en.js'
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Fills in everything a handler needs to know about a device before it is
|
|
@@ -69,9 +70,38 @@ export function applyDeviceContext(platform, accessory, device, deviceConf, join
|
|
|
69
70
|
accessory.context.useLanControl = true
|
|
70
71
|
}
|
|
71
72
|
|
|
72
|
-
//
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
// Keep the name in step with Govee - or, for a LAN-only device, with the
|
|
74
|
+
// label in the configuration.
|
|
75
|
+
//
|
|
76
|
+
// ⚠️ This used to run for LAN-only devices only, so every other device kept
|
|
77
|
+
// whatever name it was discovered under, forever. A name HAP complains about
|
|
78
|
+
// (brackets, say) could then not be cleared without deleting the cached
|
|
79
|
+
// accessory and losing its room and automations (#1344).
|
|
80
|
+
//
|
|
81
|
+
// ⚠️ This does NOT rename anything in the Home app. HomeKit fixes the name a
|
|
82
|
+
// user sees when the accessory is first added, and a rename made there never
|
|
83
|
+
// comes back to us either. What this fixes is the name Homebridge itself
|
|
84
|
+
// shows and, through the Name characteristic, the HAP warning.
|
|
85
|
+
//
|
|
86
|
+
// `updateDisplayName` is the supported way to do it - assigning to
|
|
87
|
+
// `displayName` sets only Homebridge's copy and leaves the HAP accessory
|
|
88
|
+
// behind. It arrived in Homebridge v1.10.0, and this plugin still supports
|
|
89
|
+
// ^1.6.0, hence the check.
|
|
90
|
+
if (device.deviceName && accessory.displayName !== device.deviceName) {
|
|
91
|
+
platform.log('[%s] %s [%s].', accessory.displayName, platformLang.devRenamed, device.deviceName)
|
|
92
|
+
|
|
93
|
+
if (typeof accessory.updateDisplayName === 'function') {
|
|
94
|
+
accessory.updateDisplayName(device.deviceName)
|
|
95
|
+
} else {
|
|
96
|
+
accessory.displayName = device.deviceName
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const hapChar = platform.api?.hap?.Characteristic
|
|
100
|
+
const infoService = accessory.getService?.(platform.api?.hap?.Service?.AccessoryInformation)
|
|
101
|
+
if (hapChar && infoService) {
|
|
102
|
+
infoService.updateCharacteristic(hapChar.Name, device.deviceName)
|
|
103
|
+
infoService.updateCharacteristic(hapChar.ConfiguredName, device.deviceName)
|
|
104
|
+
}
|
|
75
105
|
}
|
|
76
106
|
|
|
77
107
|
// See if we have extra HTTP client info for this device
|
package/lib/utils/lang-en.js
CHANGED
|
@@ -82,6 +82,7 @@ export default {
|
|
|
82
82
|
devNotRet: 'skipping sync as device status not retrievable',
|
|
83
83
|
devNotUpdated: 'could not be updated as',
|
|
84
84
|
devRemove: 'has been removed from Homebridge',
|
|
85
|
+
devRenamed: 'has been renamed to',
|
|
85
86
|
disableClient: 'disabling client as',
|
|
86
87
|
disabledInConfig: 'disabled in config',
|
|
87
88
|
disabling: 'Disabling plugin',
|
package/package.json
CHANGED