Skip to content

Conversation

@allenporter
Copy link
Contributor

@allenporter allenporter commented Dec 24, 2025

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

Copilot AI review requested due to automatic review settings December 24, 2025 17:24
@allenporter allenporter marked this pull request as draft December 24, 2025 17:24
Copy link
Contributor

Copilot AI left a 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_TIMEOUT from 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.
assert device.duid == "abc123"
assert device.name == "Roborock S7 MaxV"
assert device.is_connected
assert device.is_local_connected
Copy link
Contributor Author

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>
@allenporter allenporter marked this pull request as ready for review December 29, 2025 03:25
@allenporter allenporter requested a review from Lash-L December 29, 2025 03:25
@allenporter allenporter changed the title fix: Update device startup connection behavior fix: Improve device startup connection reliability for L01 devices Dec 29, 2025
@allenporter allenporter merged commit 9cf83a4 into Python-roborock:main Dec 29, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants