Cache miIO protocol sequence IDs across CLI invocations#2063
Merged
Conversation
Contributor
Author
|
These changes were generated using Claude Code under my supervision. I reviewed and approved all code before submitting. I'm not very familiar with this codebase, so apologies in advance for any mistakes. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2063 +/- ##
==========================================
- Coverage 83.30% 83.29% -0.01%
==========================================
Files 198 199 +1
Lines 19436 19475 +39
Branches 1056 1058 +2
==========================================
+ Hits 16191 16222 +31
- Misses 3063 3071 +8
Partials 182 182 ☔ View full report in Codecov by Harness. |
rytilahti
approved these changes
Jun 27, 2026
rytilahti
left a comment
Owner
There was a problem hiding this comment.
We could store some more information in the device cache, but this is a great starting point & is immediately useful for any cli users.
Devices track message sequence IDs and ignore duplicates. Without persisting the counter, restarting the CLI resets it to 0, causing devices to silently drop messages and time out. This generalizes the approach already used by the roborock vacuum CLI into the shared DeviceGroup infrastructure, so all device types benefit. Cache files are stored per-device (keyed by hashed IP) under the platformdirs user cache directory. Closes rytilahti#1751
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.
Devices track message sequence IDs and ignore duplicates. Without persisting the counter, restarting the CLI resets it to 0, causing devices to silently drop messages and time out (#1750).
This generalizes the approach already used by the roborock vacuum CLI (
vacuum_cli.py) into the sharedDeviceGroupinfrastructure, so all device types benefit automatically.device_cache.py: Per-device cache using hashed IPs (safe for IPv6) underplatformdirs.user_cache_dirclick_common.py:DeviceGroup.group_callbackloads cachedstart_idon init, savesraw_idviactx.call_on_closeFull test suite: 1298 passed (same as master), no new failures. Ruff clean.
Closes #1751