-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let Home Assistant retry after integration setup fails #71
Conversation
WalkthroughThe changes involve updating exception handling in a Home Assistant custom component, specifically for the Hue Sync Box integration. Instead of signaling a permanent error, the integration will now indicate that setup should be retried, suggesting a less fatal approach to connectivity or configuration issues. Changes
Related issues
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on X ? TipsChat with CodeRabbit Bot (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files selected for processing (2)
- custom_components/huesyncbox/init.py (2 hunks)
- tests/test_init.py (1 hunks)
Additional comments: 3
custom_components/huesyncbox/__init__.py (2)
9-9: The change in the import statement from
ConfigEntryError
toConfigEntryNotReady
aligns with the PR's objective to enable retry behavior instead of immediate failure.47-53: The change in the exception raised from
ConfigEntryError
toConfigEntryNotReady
in theasync_setup_entry
function is consistent with the PR's objective to implement a retry mechanism for the setup process.Verification successful
The change from
ConfigEntryError
toConfigEntryNotReady
in theasync_setup_entry
function does not seem to affect other parts of the codebase sinceConfigEntryError
is not used elsewhere. The PR's changes are consistent with the objective to implement a retry mechanism for the setup process.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Verify that the change in exception type is handled appropriately elsewhere in the codebase. rg 'ConfigEntryError' --type pyLength of output: 31
tests/test_init.py (1)
- 54-58: The change in the assertion from
ConfigEntryState.SETUP_ERROR
toConfigEntryState.SETUP_RETRY
correctly reflects the new expected behavior of the integration setup process. This aligns with the PR objective to handle temporary issues by retrying the setup instead of failing immediately.
Summary by CodeRabbit
Bug Fixes
Tests