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:
1 parent
82cd5a8f2c
commit
b314ceb79e
2 files changed
+7
-3
No files matched your search
@@ -4,7 +4,7 @@ Makes the PC monitor's brightness controllable from Home Assistant: the monitor
|
|||||||
`light.pc_monitor` (MQTT discovery) and its brightness is set over DDC/CI.
|
`light.pc_monitor` (MQTT discovery) and its brightness is set over DDC/CI.
|
||||||
|
|
||||||
- Home Assistant 1-255 maps onto monitor brightness `min_level`..`max_level` (default 5-100).
|
- Home Assistant 1-255 maps onto monitor brightness `min_level`..`max_level` (default 5-100).
|
||||||
- "Off" sets the minimum brightness; the monitor itself stays on.
|
- "Off" sets the minimum brightness and the light stays reported as on (1%), so Adaptive Lighting keeps adapting it; the monitor itself stays on.
|
||||||
- Brightness changed with the monitor's own buttons is reported back every `poll_seconds` (default 30).
|
- Brightness changed with the monitor's own buttons is reported back every `poll_seconds` (default 30).
|
||||||
- When the PC is off the light shows as unavailable.
|
- When the PC is off the light shows as unavailable.
|
||||||
|
|
||||||
|
|||||||
+6
-2
@@ -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
|
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.
|
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).
|
switched off (power control over DDC/CI is unreliable).
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -143,7 +144,10 @@ class Bridge:
|
|||||||
log.warning("ignoring non-JSON command: %r", msg.payload)
|
log.warning("ignoring non-JSON command: %r", msg.payload)
|
||||||
return
|
return
|
||||||
if cmd.get("state") == "OFF":
|
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)
|
self.apply(self.min_level)
|
||||||
else:
|
else:
|
||||||
self.on = True
|
self.on = True
|
||||||
|
|||||||
Reference in new issue
Block a user