mirror of https://github.com/jetkvm/kvm.git
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...)
This commit is contained in:
parent
f5035f28c9
commit
9896eba02a
|
@ -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")
|
||||
|
|
Loading…
Reference in New Issue