Repository navigation
Conversation
- accept a native status with dpi/polling only - treat a dpi or polling rate of 0 as unread - update the mouse row without touching the tray or the battery alerts - cover both cases with tests
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Mice without battery telemetry can now show DPI and polling rate and appear awake. The change uses existing device persistence while keeping settings-only readings out of battery tray and alert handling. Notes:
You can add or adjust custom eligibility rules. Learn more. |
Summary
Bridge dropped a native status that had no battery, so a mouse whose driver reads DPI and polling rate but no battery never got them on its Home row. This keeps those settings.
NativeStatus.batteryis now optional.parse_statusaccepts a reply with DPI and/or polling rate and no battery, and returnsNoneonly when the reply has neither.0reads as unknown: drivers fill in 0 for what they could not read (a mouse asleep behind its receiver), which used to show as "0 DPI".BridgeService::record_native_settings, which updates the known-device row (DPI, polling, awake) and leaves the battery list alone, so the tray icon and the low-battery alert are unchanged.Some; no behavior change.The polling interval is unchanged: settings refresh with the existing 5-minute status read.
Motivation
The 8BitDo Retro R8 reports DPI and polling rate through its 2.4 GHz receiver but no battery (OpenMouse-Project/mouse-protocol#326). With that driver installed in
native-hid, the R8's row now readsConnected · 1200 DPI · 500 Hzinstead ofConnected. This change has no effect until amouse-protocolrelease with that driver is pinned here.Testing
cargo fmt --check,cargo clippy --locked --all-targets -- -D warningsandcargo test --lockedpass.native-hid(npm install --no-save):live_micereadsbattery: None, dpi: Some(1200), polling_rate_hz: Some(500), and/v1/statuslists the R8 as connected withdpi: 1200, pollingRateHz: 500and an emptybatteries.🤖 Generated with Claude Code
Note
Make
NativeStatus.batteryoptional so batteryless mice show DPI and polling rateChanges
NativeStatus.batteryfromNativeBatterytoOption<NativeBattery>in native_hid.rs. Status replies with DPI or polling-rate settings are now parsed even without battery data; zero DPI and polling-rate values are treated as unknown.BridgeService.record_native_settingsin service.rs to record settings-only native reads. It marks the device as not asleep, updates the known-device record, and leaves the battery list empty.lamzu.read_statusandpulsar.read_statusto wrap battery inSomefor the new optional field.native_hid.parse_statusreturnsNonefor replies with neither battery nor nonzero DPI/polling-rate values; thepoll_devicesdebug message forNonenow refers to battery or settings readers.Macroscope summarized bdf5301.
Summary by CodeRabbit