bugfix: rest segments when leds are switched off/on

based on an idea from @blazoncek in 4cc2cc4ad4 (diff-749825f808f7ce1ce1108fffc7ed037085160a63cad32397135dfc0063494373R56)
This commit is contained in:
Frank
2024-10-27 16:43:21 +01:00
parent 73b7fa7d35
commit cff17861a4
5 changed files with 6 additions and 4 deletions

View File

@@ -430,7 +430,7 @@ bool deserializeState(JsonObject root, byte callMode, byte presetId)
}
}
int tr = -1;
long tr = -1;
if (!presetId || currentPlaylist < 0) { //do not apply transition time from preset if playlist active, as it would override playlist transition times
tr = root[F("transition")] | -1;
if (tr >= 0)
@@ -463,7 +463,7 @@ bool deserializeState(JsonObject root, byte callMode, byte presetId)
strip.setTransition(transitionDelayTemp); // required here for color transitions to have correct duration
tr = root[F("tb")] | -1;
if (tr >= 0) strip.timebase = ((uint32_t)tr) - millis();
if (tr >= 0) strip.timebase = ((unsigned long)tr) - millis();
JsonObject nl = root["nl"];
nightlightActive = nl["on"] | nightlightActive;