Fix asuswrt network failure startup#33485
Fix asuswrt network failure startup#33485MartinHjelmare merged 22 commits intohome-assistant:devfrom
Conversation
|
Hey there @kennedyshead, mind taking a look at this pull request as its been labeled with a integration ( |
Align to master
Fix for issue #home-assistant#33284 - Asuswrt component fail at startup after power failure
This reverts commit a2ccdda.
2ea8e52 to
9b5d9e8
Compare
bdraco
left a comment
There was a problem hiding this comment.
Looks like the test_specify_non_directory_path_for_dnsmasq test is failing
MartinHjelmare
left a comment
There was a problem hiding this comment.
Good!
There is potential for making the tests more robust. That can be a future PR.
| hass, DOMAIN, {DOMAIN: {CONF_HOST: "fake_host", CONF_USERNAME: "fake_user"}} | ||
| ) | ||
| assert result | ||
| assert hass.data.get(DATA_ASUSWRT, None) is None |
There was a problem hiding this comment.
It would be better if we tested the existence of states in the state machine. When there's an error there shouldn't be any states. After the error clears, the setup should complete and states be created. That way we don't rely on the details of our implementation in the tests.
There was a problem hiding this comment.
Ok, I will keeep in consideration for next PR. Thx
* Fix network failure startup Fix for issue ##33284 - Asuswrt component fail at startup after power failure * Removed comment * Removed bare except * is_connected moved out try-catch * Removed pointless-string-statement * Raise PlatformNotReady on "not is_connected" * Removed unnecessary check * Revert "Removed unnecessary check" This reverts commit a2ccdda. * Implemented custom retry mechanism * Fix new line missing * Fix formatting * Fix indent * Reviewed check * Recoded based on tibber implementation * Formatting review * Changes requested * Fix tests for setup retry * Updated missing test * Fixed check on Tests * Return false if not exception * Format correction
Proposed change
Fix for issue ##33284 - Asuswrt component fail at startup after power failure.
Manage exception during component initialization and raise "PlatformNotReady if exception is type "OSError" (typically will be: [Errno 101] Network is unreachable)
Type of change
Additional information
Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.The integration reached or maintains the following Integration Quality Scale: