Repository navigation
fix(service): show the battery right away when the mouse shows up just after Bridge starts - #118
Merged
snekxs merged 1 commit intoNov 13, 2026
Conversation
…t after Bridge starts The device scanner only triggered a battery read when a mouse appeared versus the previous scan, and the first scan has no previous, so a dongle that enumerated after the startup poll left the tray blank until the next 5 minute poll. The first scan now reads once if a mouse is on the bus and no reading exists; scans during a running poll are judged after it ends instead of spawning a read the poll guard would drop. No retry loop, poll interval unchanged. Refs OpenMouse-Project#79 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
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.
Refs #79 (the "tray stays blank" part only, not the Redragon reader).
The device scanner reads batteries when a mouse appears compared with the previous scan. The first scan has no previous scan, so it never triggers a read. If the dongle enumerated just after the startup battery poll (common right after boot or login), the tray had no battery until the next poll, 5 minutes later.
What changed:
Tested:
the_first_scan_reads_a_mouse_already_on_the_bus_when_no_reading_landedfor the decision (scan_wants_read): first scan with a mouse and no reading reads; with a reading, or with no mouse, it doesn't; later scans read only when a new mouse appears.cargo fmt --check,cargo test --locked, and clippy with-D warningsfor Linux and x86_64-pc-windows-gnu all pass.🤖 Generated with Claude Code