Skip to content

Commit d833e89

Browse files
committed
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...)
1 parent 7097124 commit d833e89

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

display.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,11 @@ func watchTsEvents() {
208208
// if they're not already set. This is done separately to the init routine as the "never dim"
209209
// option has the value set to zero, but time.NewTicker only accept positive values.
210210
func startBacklightTickers() {
211+
// Don't start the tickers if the display is switched off.
212+
if config.DisplayMaxBrightness == 0 {
213+
return
214+
}
215+
211216
LoadConfig()
212217
if dimTicker == nil && config.DisplayDimAfterSec != 0 {
213218
fmt.Printf("display: dim_ticker has started\n")

0 commit comments

Comments
 (0)