@homebridge-plugins/homebridge-govee 11.26.0 → 11.26.1-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 +6 -0
- package/lib/device/sensor-leak.js +1 -1
- package/lib/platform.js +56 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@homebridge-plugins/homebridge-govee` will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## v11.26.1 (Pending Release)
|
|
6
|
+
|
|
7
|
+
### Changes
|
|
8
|
+
|
|
9
|
+
- fix: report leak events relayed by a wifi gateway over AWS (#1276)
|
|
10
|
+
|
|
5
11
|
## v11.26.0 (2026-07-12)
|
|
6
12
|
|
|
7
13
|
### Changes
|
|
@@ -67,7 +67,7 @@ export default class {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
// Check to see if the provided leak status is different from the cached state
|
|
70
|
-
if (params.leakDetected !== this.cacheLeak) {
|
|
70
|
+
if (hasProperty(params, 'leakDetected') && params.leakDetected !== this.cacheLeak) {
|
|
71
71
|
// Leak status is different so update Homebridge with new values
|
|
72
72
|
this.cacheLeak = params.leakDetected
|
|
73
73
|
this.service.updateCharacteristic(this.hapChar.LeakDetected, this.cacheLeak ? 1 : 0)
|
package/lib/platform.js
CHANGED
|
@@ -19,6 +19,7 @@ import platformChars from './utils/custom-chars.js'
|
|
|
19
19
|
import { getDeviceCapabilities } from './utils/device-capabilities.js'
|
|
20
20
|
import eveChars from './utils/eve-chars.js'
|
|
21
21
|
import {
|
|
22
|
+
base64ToHex,
|
|
22
23
|
hasProperty,
|
|
23
24
|
parseDeviceId,
|
|
24
25
|
parseError,
|
|
@@ -1372,6 +1373,14 @@ export default class {
|
|
|
1372
1373
|
}
|
|
1373
1374
|
}
|
|
1374
1375
|
|
|
1376
|
+
// Gateway subdevices (e.g. leak sensors paired to an H5044) include
|
|
1377
|
+
// their gateway id and slot number, which we need to match real-time
|
|
1378
|
+
// leak events relayed by the gateway over AWS (#1276)
|
|
1379
|
+
if (hasProperty(parsed, 'sno') && parsed.gatewayInfo?.device) {
|
|
1380
|
+
accessory.context.gatewaySno = parsed.sno
|
|
1381
|
+
accessory.context.gatewayDevice = parsed.gatewayInfo.device
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1375
1384
|
// Get a min and max temperature/humidity range to show in the homebridge-ui
|
|
1376
1385
|
if (hasProperty(parsed, 'temCali')) {
|
|
1377
1386
|
accessory.context.minTemp = parsed.temMin / 100
|
|
@@ -1522,6 +1531,13 @@ export default class {
|
|
|
1522
1531
|
if (platformConsts.models.sensorLeak.includes(device1.sku)) {
|
|
1523
1532
|
accessory.logDebug(`raw data: ${JSON.stringify({ ...parsedData, ...parsedSettings })}`)
|
|
1524
1533
|
|
|
1534
|
+
// Keep the gateway details up to date for matching real-time leak
|
|
1535
|
+
// events relayed by the gateway over AWS (#1276)
|
|
1536
|
+
if (hasProperty(parsedSettings, 'sno') && parsedSettings.gatewayInfo?.device) {
|
|
1537
|
+
accessory.context.gatewaySno = parsedSettings.sno
|
|
1538
|
+
accessory.context.gatewayDevice = parsedSettings.gatewayInfo.device
|
|
1539
|
+
}
|
|
1540
|
+
|
|
1525
1541
|
// Leak Sensors - check to see of any warnings if the lastTime is above 0
|
|
1526
1542
|
let hasUnreadLeak = false
|
|
1527
1543
|
if (parsedData.lastTime > 0) {
|
|
@@ -1805,9 +1821,46 @@ export default class {
|
|
|
1805
1821
|
receiveUpdateAWS(payload) {
|
|
1806
1822
|
const accessoryUUID = this.api.hap.uuid.generate(payload.device)
|
|
1807
1823
|
const accessory = devicesInHB.get(accessoryUUID)
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1824
|
+
if (accessory) {
|
|
1825
|
+
this.receiveDeviceUpdate(accessory, {
|
|
1826
|
+
source: 'AWS',
|
|
1827
|
+
...payload,
|
|
1828
|
+
})
|
|
1829
|
+
return
|
|
1830
|
+
}
|
|
1831
|
+
|
|
1832
|
+
// No matching accessory - the message may be from a wifi gateway (e.g. H5044)
|
|
1833
|
+
// relaying an update for one of its subdevices, such as a leak sensor (#1276)
|
|
1834
|
+
this.receiveUpdateAWSGateway(payload)
|
|
1835
|
+
}
|
|
1836
|
+
|
|
1837
|
+
receiveUpdateAWSGateway(payload) {
|
|
1838
|
+
(payload?.op?.command || []).forEach((command) => {
|
|
1839
|
+
let hexString
|
|
1840
|
+
try {
|
|
1841
|
+
hexString = base64ToHex(command)
|
|
1842
|
+
} catch {
|
|
1843
|
+
return
|
|
1844
|
+
}
|
|
1845
|
+
|
|
1846
|
+
// 0xEE34 is a gateway subdevice status, laid out as:
|
|
1847
|
+
// ee 34 [subdevice number] 02 00 64 1e 14 [seq] [unix time x4] [leak flags x4] 80 00 [checksum]
|
|
1848
|
+
if (!hexString.startsWith('ee34') || hexString.length < 36) {
|
|
1849
|
+
return
|
|
1850
|
+
}
|
|
1851
|
+
const subdeviceNo = Number.parseInt(hexString.substring(4, 6), 16)
|
|
1852
|
+
const leakDetected = hexString.substring(26, 34) !== '00000000'
|
|
1853
|
+
|
|
1854
|
+
// Match the update to the leak sensor with this gateway and slot number
|
|
1855
|
+
devicesInHB.forEach((accessory) => {
|
|
1856
|
+
if (
|
|
1857
|
+
accessory.context.gatewayDevice === payload.device
|
|
1858
|
+
&& accessory.context.gatewaySno === subdeviceNo
|
|
1859
|
+
&& platformConsts.models.sensorLeak.includes(accessory.context.gvModel)
|
|
1860
|
+
) {
|
|
1861
|
+
this.receiveDeviceUpdate(accessory, { source: 'AWS', leakDetected })
|
|
1862
|
+
}
|
|
1863
|
+
})
|
|
1811
1864
|
})
|
|
1812
1865
|
}
|
|
1813
1866
|
|
package/package.json
CHANGED