diff --git a/wled00/cfg.cpp b/wled00/cfg.cpp
index e51b666e4..6ccf8aa44 100644
--- a/wled00/cfg.cpp
+++ b/wled00/cfg.cpp
@@ -632,12 +632,12 @@ static const char s_cfg_json[] PROGMEM = "/cfg.json";
void deserializeConfigFromFS() {
bool success = deserializeConfigSec();
+ #ifdef WLED_ADD_EEPROM_SUPPORT
if (!success) { //if file does not exist, try reading from EEPROM
- #ifdef WLED_ADD_EEPROM_SUPPORT
deEEPSettings();
return;
- #endif
}
+ #endif
if (!requestJSONBufferLock(1)) return;
diff --git a/wled00/const.h b/wled00/const.h
index 540d0946b..73873d041 100644
--- a/wled00/const.h
+++ b/wled00/const.h
@@ -375,6 +375,7 @@
//Playlist option byte
#define PL_OPTION_SHUFFLE 0x01
+#define PL_OPTION_RESTORE 0x02
// Segment capability byte
#define SEG_CAPABILITY_RGB 0x01
diff --git a/wled00/data/index.js b/wled00/data/index.js
index 36c3eb1b9..4ad2044ad 100644
--- a/wled00/data/index.js
+++ b/wled00/data/index.js
@@ -1984,7 +1984,7 @@ function makeP(i,pl)
End preset:
diff --git a/wled00/data/settings_wifi.htm b/wled00/data/settings_wifi.htm
index 76e733671..3577e80d2 100644
--- a/wled00/data/settings_wifi.htm
+++ b/wled00/data/settings_wifi.htm
@@ -84,7 +84,7 @@
option.textContent = "Other network...";
select.appendChild(option);
- if (input.value === "" || found) input.replaceWith(select);
+ if (input.value === "" || input.value === "Your_Network" || found) input.replaceWith(select);
else select.remove();
}
diff --git a/wled00/fcn_declare.h b/wled00/fcn_declare.h
index 20ac21129..f1b013e99 100644
--- a/wled00/fcn_declare.h
+++ b/wled00/fcn_declare.h
@@ -233,6 +233,7 @@ const char *getPresetsFileName(bool persistent = true);
void initPresetsFile();
void handlePresets();
bool applyPreset(byte index, byte callMode = CALL_MODE_DIRECT_CHANGE);
+bool applyPresetFromPlaylist(byte index);
void applyPresetWithFallback(uint8_t presetID, uint8_t callMode, uint8_t effectID = 0, uint8_t paletteID = 0);
inline bool applyTemporaryPreset() {return applyPreset(255);};
void savePreset(byte index, const char* pname = nullptr, JsonObject saveobj = JsonObject());
diff --git a/wled00/playlist.cpp b/wled00/playlist.cpp
index bcbcb4516..882ccb0e0 100644
--- a/wled00/playlist.cpp
+++ b/wled00/playlist.cpp
@@ -109,7 +109,10 @@ int16_t loadPlaylist(JsonObject playlistObj, byte presetId) {
if (playlistRepeat > 0) playlistRepeat++; //add one extra repetition immediately since it will be deducted on first start
playlistEndPreset = playlistObj["end"] | 0;
// if end preset is 255 restore original preset (if any running) upon playlist end
- if (playlistEndPreset == 255 && currentPreset > 0) playlistEndPreset = currentPreset;
+ if (playlistEndPreset == 255 && currentPreset > 0) {
+ playlistEndPreset = currentPreset;
+ playlistOptions |= PL_OPTION_RESTORE; // for async save operation
+ }
if (playlistEndPreset > 250) playlistEndPreset = 0;
shuffle = shuffle || playlistObj["r"];
if (shuffle) playlistOptions |= PL_OPTION_SHUFFLE;
@@ -135,7 +138,7 @@ void handlePlaylist() {
if (!playlistIndex) {
if (playlistRepeat == 1) { //stop if all repetitions are done
unloadPlaylist();
- if (playlistEndPreset) applyPreset(playlistEndPreset);
+ if (playlistEndPreset) applyPresetFromPlaylist(playlistEndPreset);
return;
}
if (playlistRepeat > 1) playlistRepeat--; // decrease repeat count on each index reset if not an endless playlist
@@ -146,7 +149,7 @@ void handlePlaylist() {
jsonTransitionOnce = true;
strip.setTransition(fadeTransition ? playlistEntries[playlistIndex].tr * 100 : 0);
playlistEntryDur = playlistEntries[playlistIndex].dur;
- applyPreset(playlistEntries[playlistIndex].preset);
+ applyPresetFromPlaylist(playlistEntries[playlistIndex].preset);
}
}
@@ -157,7 +160,7 @@ void serializePlaylist(JsonObject sObj) {
JsonArray dur = playlist.createNestedArray("dur");
JsonArray transition = playlist.createNestedArray(F("transition"));
playlist[F("repeat")] = (playlistIndex < 0 && playlistRepeat > 0) ? playlistRepeat - 1 : playlistRepeat; // remove added repetition count (if not yet running)
- playlist["end"] = playlistEndPreset;
+ playlist["end"] = playlistOptions & PL_OPTION_RESTORE ? 255 : playlistEndPreset;
playlist["r"] = playlistOptions & PL_OPTION_SHUFFLE;
for (int i=0; i