Repository navigation
chore: bump version to 2.0.0.B4 - #167
Conversation
| HiveInvalidUsername, | ||
| HiveInvalidPassword, | ||
| ), | ||
| retry_on=(HiveApiError,), |
There was a problem hiding this comment.
🤖 Claude Code Review
retry_on=(HiveApiError,) changes the failure contract of _retry_login. Before, any exception from login() was retried 3 times and then became HiveReauthRequired. Now anything that isn't a HiveApiError escapes on the first attempt, with no retry and no conversion. That includes HiveInvalidDeviceAuthentication (saved device credentials rejected, which is what needs a re-login), raw botocore/aiohttp errors from the Cognito calls, and KeyError/TypeError from malformed responses.
The CLAUDE.md contract says HiveReauthRequired is the only exception application code has to handle. Home Assistant maps that exception to ConfigEntryAuthFailed (reauth flow). With this change, a rejected device login or a transient network error during refresh surfaces as an unhandled exception, so setup fails with a generic error instead of a reauth prompt or a retry.
Suggested fix: keep retrying and converting these cases. For example, add HiveInvalidDeviceAuthentication to retry_on or to a conversion to HiveReauthRequired. Alternatively, wrap transport errors in HiveConnectionError at the login() boundary so HiveApiError covers them.
🤖 Claude Code ReviewVerdict: mostly good, but one behaviour regression in Bugs
Should fix
Minor
Home Assistant check
Not reviewed
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 #167 +/- ##
=======================================
Coverage 99.96% 99.96%
=======================================
Files 30 30
Lines 2599 2643 +44
Branches 306 310 +4
=======================================
+ Hits 2598 2642 +44
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
…dle options=None
Add HiveInvalidDeviceAuthentication to the set of exceptions that trigger
HiveReauthRequired in _retry_login, since rejected device credentials need
a fresh SMS login. Replace config.get("options", {}) with
(config.get("options") or {}) so options=None doesn't raise AttributeError.
Add tests for both cases.
🤖 Claude Code ReviewVerdict: no new bugs found. The earlier Bugs
Should fix
Minor
Home Assistant check
Not reviewed
Automated review by Claude Code · workflow run |
Change int() to round() in LightColorHandler.get_color so HSV->RGB conversion rounds channels instead of truncating (2.55 -> 3, not 2). Remove retry_on parameter from _retry_with_delays since it always retried Exception anyway. Retry every login failure (network, malformed response, library errors) in _retry_login instead of only HiveApiError, converting all exhausted retries to HiveReauthRequired. Add tests for channel rounding and transient failure
🤖 Claude Code ReviewVerdict: no blocking issues found. The earlier Bugs
Minor
Home Assistant check
Not reviewed
Automated review by Claude Code · workflow run |
No description provided.