diff --git a/wled00/json.cpp b/wled00/json.cpp index 35d19198..64254963 100644 --- a/wled00/json.cpp +++ b/wled00/json.cpp @@ -597,6 +597,8 @@ bool deserializeState(JsonObject root, byte callMode, byte presetId) } } + doAdvancePlaylist = root[F("np")] | doAdvancePlaylist; //advances to next preset in playlist when true + stateUpdated(callMode); if (presetToRestore) currentPreset = presetToRestore; diff --git a/wled00/playlist.cpp b/wled00/playlist.cpp index 236cc324..1d6f7a99 100644 --- a/wled00/playlist.cpp +++ b/wled00/playlist.cpp @@ -137,7 +137,7 @@ void handlePlaylist() { return; // but don't progress to next extry, and don't shuffle } - if (millis() - presetCycledTime > (100*playlistEntryDur)) { +if (millis() - presetCycledTime > (100 * playlistEntryDur) || doAdvancePlaylist) { presetCycledTime = millis(); if (bri == 0 || nightlightActive) return; @@ -159,6 +159,7 @@ void handlePlaylist() { transitionDelayTemp = playlistEntries[playlistIndex].tr * 100; playlistEntryDur = playlistEntries[playlistIndex].dur; applyPreset(playlistEntries[playlistIndex].preset); + doAdvancePlaylist = false; } } diff --git a/wled00/set.cpp b/wled00/set.cpp index 3b7c8a9c..31fbb784 100644 --- a/wled00/set.cpp +++ b/wled00/set.cpp @@ -922,6 +922,9 @@ bool handleSet(AsyncWebServerRequest *request, const String& req, bool apply) applyPreset(presetCycCurr); } + pos = req.indexOf(F("NP")); //advances to next preset in a playlist + if (pos > 0) doAdvancePlaylist = true; + //set brightness updateVal(req.c_str(), "&A=", &bri); diff --git a/wled00/wled.h b/wled00/wled.h index b0697f5b..a0e4283e 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -653,6 +653,7 @@ WLED_GLOBAL byte timerWeekday[] _INIT_N(({ 255, 255, 255, 255, 255, 255, 255, WLED_GLOBAL byte timerMonth[] _INIT_N(({28,28,28,28,28,28,28,28})); WLED_GLOBAL byte timerDay[] _INIT_N(({1,1,1,1,1,1,1,1})); WLED_GLOBAL byte timerDayEnd[] _INIT_N(({31,31,31,31,31,31,31,31})); +WLED_GLOBAL bool doAdvancePlaylist _INIT(false); //improv WLED_GLOBAL byte improvActive _INIT(0); //0: no improv packet received, 1: improv active, 2: provisioning