feat(hid): add rgb-effects lighting and receiver routing - #351
Merged
AprilNEA merged 2 commits intoSep 15, 2026
Merged
Conversation
4 tasks
davidbudnick
marked this pull request as ready for review
August 10, 2026 00:54
|
Collaborator
|
@LuisUrrutia Can you please rebase and address comments? |
10 tasks
LuisUrrutia
force-pushed
the
g502-x-plus-lightspeed-lighting
branch
from
August 27, 2026 12:48
6f038d9 to
f200fa8
Compare
LuisUrrutia
force-pushed
the
g502-x-plus-lightspeed-lighting
branch
from
August 27, 2026 14:29
f200fa8 to
99f72a7
Compare
LuisUrrutia
force-pushed
the
g502-x-plus-lightspeed-lighting
branch
from
August 27, 2026 14:48
a447877 to
f51b07f
Compare
Adopt the RGB lighting path from PR AprilNEA#351 on current master. Discover static effects before taking software control, preserve native write and receiver ownership through cancellation, and reject stale control acknowledgements during rollback. Retain the existing capability-driven UI and volatile writes. Standalone commands drain cleanup before exiting; agent requests can time out without aborting it. Co-authored-by: Luis Urrutia <luis@urrutia.me> Co-authored-by: Xuan Zhang <xuan@arcbox.dev>
Reuse the diagnostic selector for lighting-capable devices, including 0x8071. Skip receiver entries whose device route cannot be resolved instead of misaddressing them as direct devices. Co-authored-by: Luis Urrutia <luis@urrutia.me> Co-authored-by: Xuan Zhang <xuan@arcbox.dev>
AprilNEA
force-pushed
the
g502-x-plus-lightspeed-lighting
branch
from
September 15, 2026 17:16
f51b07f to
b1b7f9e
Compare
AprilNEA
approved these changes
Sep 15, 2026
AprilNEA
added a commit
that referenced
this pull request
Sep 15, 2026
Adopt the RGB lighting path from PR #351 on current master. Discover static effects before taking software control, preserve native write and receiver ownership through cancellation, and reject stale control acknowledgements during rollback. Retain the existing capability-driven UI and volatile writes. Standalone commands drain cleanup before exiting; agent requests can time out without aborting it. Co-authored-by: Luis Urrutia <luis@urrutia.me> Co-authored-by: Xuan Zhang <xuan@arcbox.dev>
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.
Summary
Add the missing
0x8071RGB-effects solid-color write path and letdiag lightingaddress devices through receiver slots, including LIGHTSPEED, instead of requiring direct USB attachment.This revision adopts the lighting contribution onto current
masterand narrows the PR to lighting and diagnostic routing. The earlier G502-specific button UI, model-derived capabilities, and obsolete locale changes are not included. Gaming-button and onboard-profile work remains separate: #949, #1350, and #1002.Changes
openlogi-hidpp: add write-through requests that finish the native transport write before starting the response deadline. Match the software-control response fields defined by the Logitech specification so a late claim ACK with different flags cannot satisfy a restoration request.openlogi-device: discover a static effect for every RGB cluster before taking software control. Prefer0x8070 → 0x8071 → 0x8081 → 0x8080; fall back only before claiming RGB control. Write volatile effects, preserve unrelated flags, and attempt to restore the previous software-control/event flags on failure, cancellation, or timeout. Surface restoration failures.openlogi-hid: serialize lighting transactions per route on an owned worker that survives requester/runtime cancellation. A foreground agent request can stop waiting without aborting cleanup; standalone commands wait for cleanup before exiting.openlogi-agent-core/openlogi-agent: keep the receiver lease through the transaction and cleanup, resolve the authoritative channel after acquiring the route lock, and stop writes when its publication is retired or host I/O is suspended.openlogi-core: derive lighting capability from the live0x8071feature alongside the existing lighting families, reusing the existing Lighting panel without model-name special cases or wire-format changes.openlogi-cli: reuse diagnostic device selection for lighting and skip receiver entries without a resolvable route rather than treating them as directly attached devices.Testing
Run in a Linux environment with Rust 1.98:
#007aff), set brightness to 50%, and toggled lighting off. Mock-agent IPC logs confirmed the color, brightness, and enabled flag reached receiver slot 3. This verifies UI/IPC behavior, not physical lighting.Hardware verification: connect a G502 X Plus through its LIGHTSPEED receiver, confirm the Lighting tab is offered, then test solid colors, brightness, and off/on from the GUI and
openlogi diag lighting 1782c4 --device "G502". Confirm every supported cluster updates and saved lighting reapplies after reconnect. Also check an existing0x8070/per-key device for regressions.Cleanup restores control/event flags, not a snapshot of prior effects. Successful volatile lighting keeps software control asserted. Disconnect, process termination, or a permanently stuck native transport write cannot guarantee restoration; cleanup never reopens a retired channel or writes an old snapshot through its replacement.