From 9896eba02a9cb0784d3ef9a2200f51b3d0da4f70 Mon Sep 17 00:00:00 2001 From: Cameron Fleming Date: Tue, 28 Jan 2025 21:49:26 +0000 Subject: [PATCH] fix(display): Don't attempt to start the tickers if the display is disabled If max_brightness is zero, then there's no point in trying to dim it (or turn it off...) --- display.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/display.go b/display.go index ab208d1..37a5984 100644 --- a/display.go +++ b/display.go @@ -208,6 +208,11 @@ func watchTsEvents() { // if they're not already set. This is done separately to the init routine as the "never dim" // option has the value set to zero, but time.NewTicker only accept positive values. func startBacklightTickers() { + // Don't start the tickers if the display is switched off. + if config.DisplayMaxBrightness == 0 { + return + } + LoadConfig() if dimTicker == nil && config.DisplayDimAfterSec != 0 { fmt.Printf("display: dim_ticker has started\n")