diff --git a/wled00/json.cpp b/wled00/json.cpp index 89f12319d7..d5be5ac5cb 100644 --- a/wled00/json.cpp +++ b/wled00/json.cpp @@ -573,7 +573,6 @@ bool deserializeState(JsonObject root, byte callMode, byte presetId) ps = presetCycCurr; if (root["win"].isNull() && getVal(root["ps"], &ps, 0, 0) && ps > 0 && ps < 251 && ps != currentPreset) { // b) preset ID only or preset that does not change state (use embedded cycling limits if they exist in getVal()) - presetCycCurr = ps; unloadPlaylist(); // applying a preset unloads the playlist applyPreset(ps, callMode); // async load from file system (only preset ID was specified) if (iAmGroot) suspendStripService = false; // WLEDMM release lock diff --git a/wled00/presets.cpp b/wled00/presets.cpp index 3beab1b862..46e8a53d70 100644 --- a/wled00/presets.cpp +++ b/wled00/presets.cpp @@ -125,11 +125,21 @@ void initPresetsFile() f.close(); } +#if 0 // not used in WLEDMM +bool applyPresetFromPlaylist(byte index) +{ + DEBUG_PRINTF_P(PSTR("Request to apply preset: %d\n"), index); + presetToApply = presetCycCurr = index; + callModeToApply = CALL_MODE_DIRECT_CHANGE; + return true; +} +#endif + bool applyPreset(byte index, byte callMode) { DEBUG_PRINT(F("Request to apply preset: ")); DEBUG_PRINTLN(index); - presetToApply = index; + presetToApply = presetCycCurr = index; callModeToApply = callMode; return true; } diff --git a/wled00/wled.h b/wled00/wled.h index 212c390b74..5c34621171 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -337,8 +337,6 @@ WLED_GLOBAL int8_t irPin _INIT(IRPIN); constexpr uint8_t hardwareTX = 1; #endif -//WLED_GLOBAL byte presetToApply _INIT(0); - WLED_GLOBAL char ntpServerName[33] _INIT("0.wled.pool.ntp.org"); // NTP server to use // WiFi CONFIG (all these can be changed via web UI, no need to set them here)