fix: fallback to the cached network information on failure#606
Merged
allenporter merged 2 commits intoPython-roborock:mainfrom Nov 29, 2025
Merged
fix: fallback to the cached network information on failure#606allenporter merged 2 commits intoPython-roborock:mainfrom
allenporter merged 2 commits intoPython-roborock:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a fallback mechanism to use cached network information when retrieving the latest network information fails. The implementation renames the use_cache parameter to prefer_cache to better reflect its behavior and adds exception handling to fall back to cached data on network errors.
Key Changes
- Enhanced
_get_networking_info()to fall back to cached network info when the MQTT network info request fails - Renamed
use_cacheparameter toprefer_cacheacross all affected methods for clarity - Added comprehensive test coverage for the new fallback behavior
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| roborock/devices/v1_channel.py | Implements fallback logic to use cached network info on failure and renames parameter from use_cache to prefer_cache |
| tests/devices/test_v1_channel.py | Adds test for fallback behavior, introduces shared cache fixture, and updates TEST_HOST to use centralized mock_data constant |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Lash-L
previously approved these changes
Nov 29, 2025
Collaborator
Lash-L
left a comment
There was a problem hiding this comment.
good outside copilot comments. can re-approve
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Lash-L
approved these changes
Nov 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.
Use the cached network info when looking up the latest network information fails.