Skip to content

new(interface): add SetBl method to set an absolute backlight level - #330

Open
anton-sugl wants to merge 1 commit into
FedeDP:masterfrom
anton-sugl:pr/setbl
Open

anton-sugl wants to merge 1 commit into
FedeDP:masterfrom
anton-sugl:pr/setbl

Conversation

@anton-sugl

Copy link
Copy Markdown

Add SetBl D-Bus method to set an absolute backlight level

IncBl and DecBl only change the backlight relative to the current level. This adds SetBl(d)
to org.clight.clight, which sets the backlight to an absolute level between 0.0 and 1.0.

  • Reuses the existing handler and backlight request, so smooth transitions, monitor overrides and
    the other backlight logic behave as for IncBl/DecBl.
  • SetBl accepts 0.0 (screen off level); IncBl/DecBl still require a positive step, unchanged.
  • Values outside [0.0, 1.0] are rejected with EINVAL, like for the other two methods.
  • Method is SD_BUS_VTABLE_UNPRIVILEGED, consistent with IncBl/DecBl.

Note

TODO.md lists moving Capture/IncBl/DecBl to org.clight.clight.Conf.Backlight.
I kept SetBl next to them for consistency; happy to move it together with them.

Testing

Built with the CI dependencies, no new warnings. On a private session bus: SetBl 0.0, 0.5 and 1.0
are accepted, 1.5 and -0.1 rejected; IncBl/DecBl 0.0 still rejected, 0.1 accepted; clean shutdown.

🤖 Generated with Claude Code

Signed-off-by: Anton S-G <257776033+anton-sugl@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant