From e9e26b962376baf41476b3b14add6d7bf58d64f8 Mon Sep 17 00:00:00 2001 From: Dreaded_X Date: Sun, 6 Feb 2022 23:49:15 +0100 Subject: [PATCH] Prevent the lights from dimming when they get turned on early --- main.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 09f505e..a84ddd7 100644 --- a/main.go +++ b/main.go @@ -245,8 +245,10 @@ events: fmt.Println("\tGradually turning on lights in the living room") // Start the ticker to gradually turn on the living room lights ticker.Reset(1200 * time.Millisecond) - livingRoom.Bri(brightness) - livingRoom.Ct(Temperature) + if (livingRoom.State.Bri < brightness) { + livingRoom.Bri(brightness) + livingRoom.Ct(Temperature) + } } // Set new timer