Repository navigation
refactor: handle incomplete Hive API state responses without error logs - #162
Conversation
Replace try/except KeyError blocks in heating/hotwater get_mode with early returns when state.mode is missing. Add _keep_missing_state to PollingMixin that carries over dropped state keys from the previous poll for up to MAX_STALE_STATE_POLLS (5) consecutive incomplete responses, logging a warning per poll listing affected products and missing keys, plus a debug log showing the keys that did arrive. After the threshold, accept
🤖 Claude Code ReviewVerdict: Mostly sound, but the carry-over of "missing" state keys can show stale state in Home Assistant. Should fix before merge. Bugs
Other findings
Home Assistant check: fetched Not reviewed: the sync ( Automated review by Claude Code · workflow run |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #162 +/- ##
=======================================
Coverage 99.96% 99.96%
=======================================
Files 30 30
Lines 2576 2599 +23
Branches 297 306 +9
=======================================
+ Hits 2575 2598 +23
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Keys Hive may legitimately omit (boost, the colour keys) were kept from the previous poll for up to five polls, which could report stale state such as boost ON. Carry over only mode, name, status and target, and drop the per-product count for products that leave the response. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🤖 Claude Code ReviewVerdict: Looks good. I found no blocking bugs, and the concerns from the earlier review are addressed. Bugs: none found. Other findings
Home Assistant check: I fetched Not reviewed: the generated sync Automated review by Claude Code · workflow run |
🤖 Claude Code ReviewVerdict: Looks good. I found no blocking bugs. Bugs: none found. Other findings
Home Assistant check: I fetched Not reviewed: the generated sync Automated review by Claude Code · workflow run |
Replace try/except KeyError blocks in heating/hotwater get_mode with early returns when state.mode is missing. Add _keep_missing_state to PollingMixin that carries over dropped state keys from the previous poll for up to MAX_STALE_STATE_POLLS (5) consecutive incomplete responses, logging a warning per poll listing affected products and missing keys, plus a debug log showing the keys that did arrive. After the threshold, accept