@homebridge-plugins/homebridge-govee 11.29.3 → 11.30.0-beta.0
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 +7 -0
- package/lib/connection/ble.js +5 -9
- package/lib/platform.js +2 -0
- package/lib/utils/command-builder.js +9 -1
- package/lib/utils/response-parser.js +11 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@homebridge-plugins/homebridge-govee` will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## v11.30.0 (Pending Release)
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- chore(ble): let noble apply its own adapter timeout instead of racing a second one
|
|
10
|
+
- fix: restore aws brightness scaling, so lights reach the brightness asked for (#1262) (@gradyg21)
|
|
11
|
+
|
|
5
12
|
## v11.29.3 (2026-07-21)
|
|
6
13
|
|
|
7
14
|
### Changed
|
package/lib/connection/ble.js
CHANGED
|
@@ -174,20 +174,16 @@ export default class BLEConnection {
|
|
|
174
174
|
return true
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
-
let timeoutId
|
|
178
177
|
try {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
])
|
|
178
|
+
// noble applies the timeout itself and removes its own state listener when
|
|
179
|
+
// it expires. Racing it against a second, shorter timer here just meant
|
|
180
|
+
// noble kept waiting - and holding its listener - for another five seconds
|
|
181
|
+
// after we had already given up.
|
|
182
|
+
await btClient.waitForPoweredOnAsync(timeout)
|
|
185
183
|
return true
|
|
186
184
|
} catch (err) {
|
|
187
185
|
this.log.warn('[BLE] failed to power on adapter: %s.', err.message)
|
|
188
186
|
return false
|
|
189
|
-
} finally {
|
|
190
|
-
clearTimeout(timeoutId)
|
|
191
187
|
}
|
|
192
188
|
}
|
|
193
189
|
|
package/lib/platform.js
CHANGED
|
@@ -217,6 +217,7 @@ export default class {
|
|
|
217
217
|
}
|
|
218
218
|
break
|
|
219
219
|
}
|
|
220
|
+
case 'awsBrightnessNoScale':
|
|
220
221
|
case 'hideLight':
|
|
221
222
|
case 'hideModeGreenTea':
|
|
222
223
|
case 'hideModeOolongTea':
|
|
@@ -1363,6 +1364,7 @@ export default class {
|
|
|
1363
1364
|
|
|
1364
1365
|
if (this.awsClient) {
|
|
1365
1366
|
accessory.context.useAwsControl = true
|
|
1367
|
+
accessory.context.awsBrightnessNoScale = deviceConf.awsBrightnessNoScale
|
|
1366
1368
|
accessory.context.awsColourMode = deviceConf.awsColourMode || platformConsts.defaultValues.awsColourMode
|
|
1367
1369
|
awsDevices.push(device.device)
|
|
1368
1370
|
|
|
@@ -111,7 +111,15 @@ function buildBrightnessCommand(params, context) {
|
|
|
111
111
|
return {
|
|
112
112
|
awsParams: {
|
|
113
113
|
cmd: 'brightness',
|
|
114
|
-
|
|
114
|
+
// Most devices take 0-254 over AWS, so HomeKit's 0-100 has to be scaled
|
|
115
|
+
// up. A handful expect 0-100 already and are opted out per device with
|
|
116
|
+
// `awsBrightnessNoScale`. Dropping this scaling made every AWS device
|
|
117
|
+
// land at roughly a third of the requested brightness (#1262).
|
|
118
|
+
data: {
|
|
119
|
+
val: context.awsBrightnessNoScale
|
|
120
|
+
? params.value
|
|
121
|
+
: Math.round(params.value * 2.54),
|
|
122
|
+
},
|
|
115
123
|
},
|
|
116
124
|
bleParams: {
|
|
117
125
|
cmd: CMD.BRIGHTNESS,
|
|
@@ -49,8 +49,18 @@ export function parseDeviceUpdate(params, context) {
|
|
|
49
49
|
|
|
50
50
|
// BRIGHTNESS
|
|
51
51
|
if (params.state && hasProperty(params.state, 'brightness')) {
|
|
52
|
-
|
|
52
|
+
// AWS reports 0-254 on most devices, so it has to come back down to
|
|
53
|
+
// HomeKit's 0-100. Without this every AWS reading of 100 or more clamped
|
|
54
|
+
// to full brightness (#1262). The other sources already report 0-100.
|
|
55
|
+
if (params.source === 'AWS') {
|
|
56
|
+
data.brightness = context.awsBrightnessNoScale
|
|
57
|
+
? params.state.brightness
|
|
58
|
+
: Math.round(params.state.brightness / 2.54)
|
|
59
|
+
} else {
|
|
60
|
+
data.brightness = params.state.brightness
|
|
61
|
+
}
|
|
53
62
|
}
|
|
63
|
+
// Govee occasionally sends a value outside [0, 100] anyway
|
|
54
64
|
if (hasProperty(data, 'brightness')) {
|
|
55
65
|
data.brightness = Math.max(Math.min(data.brightness, 100), 0)
|
|
56
66
|
}
|
package/package.json
CHANGED