fix: Improve device startup connection reliability for L01 devices#708
Merged
allenporter merged 3 commits intoPython-roborock:mainfrom Dec 29, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes device startup connection behavior by increasing the timeout for initial device startup from 5 to 15 seconds. This allows sufficient time for the complete connection flow including network info fetch, V1 protocol hello attempt, and potential L01 fallback before the device manager returns.
Key Changes
- Increased
START_ATTEMPT_TIMEOUTfrom 5 to 15 seconds to accommodate L01 fallback behavior - Added comprehensive end-to-end tests for device manager with both V1 and L01 devices
- Added v3 API endpoint mock for user homes to support test scenarios
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
roborock/devices/device.py |
Increased startup timeout from 5 to 15 seconds with explanatory comment |
tests/e2e/test_device_manager.py |
New end-to-end tests for V1 and L01 device connection flows |
tests/e2e/__snapshots__/test_device_manager.ambr |
Snapshot file for new end-to-end tests |
tests/e2e/__init__.py |
Added web_api_fixtures to pytest plugins list |
tests/fixtures/web_api_fixtures.py |
Added v3/user/homes endpoint mock |
.pre-commit-config.yaml |
Excluded .ambr snapshot files from codespell checks |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Increase the timeout waiting for the initial device startup to happen to wait beyond the L01 fallback behavior. Before this chnage, the device returns and is not yet conected locally (the test fails) forcing MQTT requests.
8849074 to
6f32be7
Compare
allenporter
commented
Dec 29, 2025
| assert device.duid == "abc123" | ||
| assert device.name == "Roborock S7 MaxV" | ||
| assert device.is_connected | ||
| assert device.is_local_connected |
Contributor
Author
There was a problem hiding this comment.
Note: This used to always return false here before the timeout change.
Co-authored-by: Copilot <[email protected]>
Lash-L
approved these changes
Dec 29, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Increase the timeout waiting for the initial device startup to happen to wait beyond the L01 fallback behavior. Before this change, the device returns and is not yet connected locally (the test fails) forcing MQTT requests.
Currently in draft as it depends on #705
Addresses the symptoms in home-assistant/core#159609