Commit Graph

5 Commits

Author SHA1 Message Date
Darell Tan
54aa0795c3 Fix for unacknowledged numeric Z2M state updates
So far Z2M state updates were only boolean (the device `state` on/off),
but after introducing `brightness` values, Z2M state updates may not be
recognized/acknowledged. Unmarshalled Z2M numeric values are always
float64, but updates sent out via MQTT might not be. As a result, the
values may not directly equal and may never match.

To solve this, cast the outgoing expected value into a float64 to
compare against the received Z2M value, which is already a float64.
2023-06-25 02:34:34 +08:00
Darell Tan
48eabc2342 Mark old last_seen devices as "not responding"
Devices that have not received an update since a fixed timeout (24 hrs
for now), based on its last_seen time, will be marked as "not
responding" in the Home app. With this I can identify which devices are
unreachable or dead.

Also needed to upgrade hap with the fix for brutella/hap#30, or the
entire bridge will stop working.
2023-05-22 22:38:20 +08:00
Darell Tan
edade53b06 Record & persist device last_seen time
This will allow us to mark devices as non-responsive if they haven't
been seen in some time.
2023-05-21 02:20:37 +08:00
Darell Tan
e44f33aa29 Don't persist Z2M state with "zero" values
When storing Z2M state, skip properties with default "zero" values. This
should skip devices and properties that were not updated via MQTT yet.
2023-05-14 02:09:17 +08:00
Darell Tan
84398fc53a "Initial" working version, after cleanup. 2023-04-26 23:20:07 +08:00