Open Blaubeermuffin opened 5 years ago
Just wanted to say thanks to @Blaubeermuffin for the updated code as this has fixed the night light brightness for me.
The bug found above, is not the only bug, I think :) When the clock starts in daytime, daytime brightness is oke, Then the clock switches to nightbrightness, at the desired time, but at the morningcutoff time the clock stays (1 hour) in nightbrightness. I think this should be the solution:
add
change ( currentDateTime.hour <= MORNINGCUTOFF) in ( currentDateTime.hour < MORNINGCUTOFF)
and the 2 last lines of code of this: if ( night() && USE_NIGHTCUTOFF == true ) FastLED.setBrightness (NIGHTBRIGHTNESS); else FastLED.setBrightness (DAYBRIGHTNESS);
I just tested your script and I'm pretty happy with it. Great work. I just found a small bug though with the night cutoff.
Current code:
This is checking if the current hour bigger than the night cutoff AND smaller than the morning cutoff. What you want to do instead, is to check if the current hour is bigger than the night cutoff OR smaller than the morning cutoff. You could implement it pretty easy with something like this: