eifinger / hass-weenect

Homeassistant integration for weenect
MIT License
11 stars 3 forks source link

fix!: some sensors should be "unavailable" when the tracker is offline #372

Closed andreasbrett closed 8 months ago

andreasbrett commented 8 months ago

Following sensors IMHO should not retain their last value but rather show up as unavailable when the tracker itself is offline (either because it is turned off or because it has no reception):

binary sensors

sensors

One could argue to let the battery retain its last state. IMHO it is better to indicate that the state is unclear. In the end the actual value could be far off from the last retained one. I'm not married to that idea though. The other sensors though definitely make no sense to expose when there's no signal.

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.12%. Comparing base (ac1cf1a) to head (3420a20). Report is 6 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #372 +/- ## ========================================== - Coverage 98.20% 98.12% -0.09% ========================================== Files 20 20 Lines 668 799 +131 ========================================== + Hits 656 784 +128 - Misses 12 15 +3 ``` | [Flag](https://app.codecov.io/gh/eifinger/hass-weenect/pull/372/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kevin+Eifinger) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/eifinger/hass-weenect/pull/372/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kevin+Eifinger) | `98.12% <100.00%> (-0.09%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kevin+Eifinger#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

eifinger commented 8 months ago

Nice! Thank you!!