Skip to content

fix: expose display brightness without display status command#193

Open
CoRfr wants to merge 1 commit intoleukipp:developfrom
CoRfr:fix/display-brightness-without-status
Open

fix: expose display brightness without display status command#193
CoRfr wants to merge 1 commit intoleukipp:developfrom
CoRfr:fix/display-brightness-without-status

Conversation

@CoRfr
Copy link
Copy Markdown

@CoRfr CoRfr commented Mar 17, 2026

Summary

  • Decouple displayBrightness from requiring a display status command (wlopm/kscreen-doctor/xset)
  • Allow sysfs backlight and ddcutil brightness control in kiosk sessions (e.g., Cage) where no DPMS command is available

Problem

In Cage wayland sessions (common for kiosks), none of wlopm, kscreen-doctor, or xset are available. The checkSupport() function required statusCommand for displayBrightness, so the display light entity was removed from Home Assistant even though sysfs brightness (/sys/class/backlight/*/brightness) works fine.

Supported: {
  "displayStatus": false,
  "displayBrightness": false,  ← should be true
  ...
}

Fix

  • displayBrightness now only requires sudo and a brightness path/command, independent of display status
  • displayStatus is inferred as true when brightness works (if you can control brightness, the display is on)
  • getDisplayStatus() returns "ON" as fallback when brightness is supported but no status command exists
  • setDisplayStatus() calls the callback in the default case so the init chain completes

Testing

Tested on Surface Pro 3 running TouchKio v1.4.2 in a Cage wayland session. After the fix, the display light entity appears in Home Assistant with brightness control (1-100%).

🤖 Generated with Claude Code

In Cage/kiosk sessions, display status commands (wlopm, kscreen-doctor,
xset) are unavailable, but sysfs backlight brightness still works.
Previously, displayBrightness required displayStatus, hiding the
brightness control from Home Assistant.

- Decouple displayBrightness from statusCommand requirement
- Infer displayStatus as ON when brightness is available
- Add default case in setDisplayStatus for sessions without a command

Tested on Surface Pro 3 running TouchKio in a Cage wayland session.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.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