-
Notifications
You must be signed in to change notification settings - Fork 56
fix: Improve device startup connection reliability for L01 devices #708
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
fix: Improve device startup connection reliability for L01 devices #708
Conversation
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.
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
| assert device.duid == "abc123" | ||
| assert device.name == "Roborock S7 MaxV" | ||
| assert device.is_connected | ||
| assert device.is_local_connected |
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.
Note: This used to always return false here before the timeout change.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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