Keep the monitor reported as on at minimum brightness when turned off

Reporting OFF made Adaptive Lighting stop adapting the monitor. The screen
never really turns off, so "off" now sets the minimum brightness and the
light stays on at brightness 1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mangavalkandClaude Opus 5.5 committed 2026-11-18 01:41:42 +01:00
1 parent 82cd5a8f2c
commit b314ceb79e
2 files changed
+7 -3

No files matched your search

+6 -2
View File
@@ -4,7 +4,8 @@ The light is announced with MQTT discovery, so Home Assistant (and Adaptive Ligh
can set the brightness. Changes made on the monitor itself (OSD buttons) are polled and
reported back, so Home Assistant sees them as manual changes.
"Off" in Home Assistant sets the monitor to its minimum brightness; the monitor is not
"Off" in Home Assistant sets the monitor to its minimum brightness and keeps reporting
it as on (1), so Adaptive Lighting keeps adapting it; the monitor is not
switched off (power control over DDC/CI is unreliable).
"""
@@ -143,7 +144,10 @@ class Bridge:
log.warning("ignoring non-JSON command: %r", msg.payload)
return
if cmd.get("state") == "OFF":
self.on = False
# The screen never really turns off, so stay "on" at the lowest brightness.
# Reporting OFF would make Adaptive Lighting stop adapting the monitor.
self.on = True
self.brightness = 1
self.apply(self.min_level)
else:
self.on = True