diff --git a/wled00/json.cpp b/wled00/json.cpp index 62d40e42..dcd6f1e5 100644 --- a/wled00/json.cpp +++ b/wled00/json.cpp @@ -214,7 +214,14 @@ bool deserializeSegment(JsonObject elem, byte it, byte presetId) #endif byte fx = seg.mode; - if (getVal(elem["fx"], &fx, 0, strip.getModeCount())) { //load effect ('r' random, '~' inc/dec, 0-255 exact value) + byte last = strip.getModeCount(); + // partial fix for #3605 + if (!elem["fx"].isNull() && elem["fx"].is()) { + const char *tmp = elem["fx"].as(); + if (strlen(tmp) > 3 && (strchr(tmp,'r') || strchr(tmp,'~') != strrchr(tmp,'~'))) last = 0; // we have "X~Y(r|[w]~[-])" form + } + // end fix + if (getVal(elem["fx"], &fx, 0, last)) { //load effect ('r' random, '~' inc/dec, 0-255 exact value, 5~10r pick random between 5 & 10) if (!presetId && currentPlaylist>=0) unloadPlaylist(); if (fx != seg.mode) seg.setMode(fx, elem[F("fxdef")]); } diff --git a/wled00/udp.cpp b/wled00/udp.cpp index 07ce9eb7..4644b164 100644 --- a/wled00/udp.cpp +++ b/wled00/udp.cpp @@ -195,6 +195,8 @@ void exitRealtime() { realtimeIP[0] = 0; if (useMainSegmentOnly) { // unfreeze live segment again strip.getMainSegment().freeze = false; + } else { + strip.show(); // possible fix for #3589 } updateInterfaces(CALL_MODE_WS_SEND); }