Skip to content

Commit

Permalink
Fix for Aircoookie#4154
Browse files Browse the repository at this point in the history
  • Loading branch information
blazoncek authored and softhack007 committed Oct 11, 2024
1 parent dcd1ef4 commit 23f2a5b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
1 change: 0 additions & 1 deletion wled00/json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 11 additions & 1 deletion wled00/presets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 0 additions & 2 deletions wled00/wled.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 23f2a5b

Please sign in to comment.