Closed puddly closed 2 weeks ago
Attention: Patch coverage is 97.61905%
with 1 line
in your changes missing coverage. Please review.
Project coverage is 95.25%. Comparing base (
6794a64
) to head (b8d5c57
). Report is 1 commits behind head on dev.
Files | Patch % | Lines |
---|---|---|
zha/application/platforms/number/__init__.py | 66.66% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I've foregone using the ZCL cache and instead just implement restore_external_state_attributes
for the required entities. This makes this PR much simpler.
A few platforms in ZHA uses instance attributes and complex logic to derive their state, relying on Home Assistant to persist it and restore it after startup:
light
andcover
) for Home Assistant to store this information as extra state attributes, allowing it to be restore properly. I believe this was actually a bug in the past.binary_sensor
andlock
. These effectively perform operations that change a ZCL attribute so the attribute cache can be used to maintain state.state
from other information and unfortunately will have to be directly restored (siren
).In the future, we need to explore a way to store this extra state. I think zigpy can provide a hook. Alternatively, we can invert the storage logic and have ZHA implement a database driver for zigpy.