Repository navigation
feat(led): add D-Bus method to set LED effect, color and brightness - #734
Open
sknowledge1 wants to merge 1 commit into
Open
sknowledge1 wants to merge 1 commit into
sknowledge1 wants to merge 1 commit into
Conversation
This was referenced Sep 24, 2026
sknowledge1
marked this pull request as draft
September 24, 2026 17:12
sknowledge1
force-pushed
the
ayaneo3-rgb-20260924
branch
from
October 15, 2026 09:18
c89bc80 to
aacfd84
Compare
This was referenced Oct 15, 2026
pastaq
reviewed
Oct 15, 2026
pastaq
requested changes
Nov 12, 2026
pastaq
left a comment
Contributor
There was a problem hiding this comment.
Pleat have your AI reduce the complexity of this pr, keep descriptions and comments jargon free, and ensure that it's following the latest instructions in our AGENTS.md
This is exhausting to read in it's current state, and I didn't get through half of it before I had to stop.
All new features or concepts need a preamble that states what the problem it is trying to solve is, why this is the best way to do it, and it should emphasize readability and maintainability.
sknowledge1
force-pushed
the
ayaneo3-rgb-20260924
branch
from
November 12, 2026 16:14
d98a44c to
da86309
Compare
The AYANEO 3 joystick rings have built-in effects (monocolor, breathe and rainbow), but nothing could select them. Software cycling the color flickers on this device, so the built-in effects are the best option. Add two methods to the LEDDevice D-Bus interface: - GetEffects returns the effects the LED supports, read from `effect_index`. - SetState(effect, (red, green, blue), brightness) writes the effect, color and brightness to the LED. Brightness is 0-255. InputPlumber does not save the state. Userspace decides what to set and when to set it again, for example at startup. Each method has its own polkit action. The existing `inputplumber` and `wheel` group rule already covers them. The LED functions now return `LedMcError` instead of `Box<dyn Error>`, so the new code can use `?`. Its separate read and write I/O errors become one, which removes the remaining `map_err` calls in the file. Tested on an AYANEO 3: GetEffects returned the three effects, SetState wrote each effect, color and brightness to sysfs, and an unknown effect returned an error. The LLM wrote the two D-Bus methods, the new LED functions and the error type changes, and ran the build and the device test. Prompt: reduce an earlier, larger LED change to the smallest version that follows the review comments and AGENTS.md, with no saved state and no new config options. Assisted-by: LLM
sknowledge1
force-pushed
the
ayaneo3-rgb-20260924
branch
from
November 12, 2026 21:47
da86309 to
a664865
Compare
sknowledge1
marked this pull request as ready for review
November 12, 2026 21:48
Author
|
changes as you mentioned implemented. thank you! 👍 |
This branch has not been deployed
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.
Problem
The AYANEO 3 joystick rings have built-in effects (monocolor, breathe and rainbow), but nothing in InputPlumber can select them. Cycling the color from software flickers on this device, so the built-in effects are the best option.
Solution
Two new methods on the existing
org.shadowblip.Input.Source.LEDDeviceD-Bus interface:GetEffectsreturns the effects the LED supports (read fromeffect_index).SetState(effect, (red, green, blue), brightness)writes the effect, color and brightness to the LED. Brightness is 0-255.InputPlumber does not save the state. Userspace decides what to set and when to set it again, for example at startup.
Why this way
It reuses the existing LED color and brightness functions and adds one sysfs write for the effect. There are no new config options, no background thread and no saved files, so there is little to maintain. Each method has its own polkit action, and the existing
inputplumber/wheelgroup rule already covers them.The LED functions now return
LedMcErrorinstead ofBox<dyn Error>, so the new code can use?. Its separate read and write I/O errors become one, which removes the remainingmap_errcalls in the file.Testing
Tested on an AYANEO 3:
GetEffectsreturnedmonocolor breathe rainbow,SetStatewrote each effect, color and brightness to sysfs, and an unknown effect returned an error. I did not check the lights by eye.cargo check,cargo clippy --all-targetsandcargo fmt --checkare clean.Assisted-by: LLM