mirror of https://github.com/arendst/Tasmota.git
Only reduce sleep for lights if necessary (#20146)
Co-authored-by: Shane Hird <shane@email.com>
This commit is contained in:
parent
3415453620
commit
b7b83eaaaa
|
@ -1777,9 +1777,10 @@ void LightAnimate(void)
|
|||
// make sure we update CT range in case SetOption82 was changed
|
||||
Light.strip_timer_counter++;
|
||||
|
||||
// set sleep parameter: either settings,
|
||||
// or set a maximum of PWM_MAX_SLEEP if light is on or Fade is running
|
||||
if (Light.power || Light.fade_running) {
|
||||
// Set a maximum sleep of PWM_MAX_SLEEP if Fade is running, or if light is on and
|
||||
// a frequently updating light scheme is in use. This is to allow smooth transitions
|
||||
// between light levels and colors.
|
||||
if ((Settings->light_scheme > LS_POWER && Light.power) || Light.fade_running) {
|
||||
if (TasmotaGlobal.sleep > PWM_MAX_SLEEP) {
|
||||
sleep_previous = TasmotaGlobal.sleep; // save previous value of sleep
|
||||
TasmotaGlobal.sleep = PWM_MAX_SLEEP; // set a maximum value (in milliseconds) to sleep to ensure that animations are smooth
|
||||
|
|
Loading…
Reference in New Issue