mirror of
https://github.com/wled/WLED.git
synced 2025-07-16 07:16:31 +00:00
Fix for #3827
This commit is contained in:
parent
6110b72b87
commit
b849ea8eaa
@ -21,7 +21,6 @@ void shortPressAction(uint8_t b)
|
||||
case 1: ++effectCurrent %= strip.getModeCount(); stateChanged = true; colorUpdated(CALL_MODE_BUTTON); break;
|
||||
}
|
||||
} else {
|
||||
unloadPlaylist(); // applying a preset unloads the playlist
|
||||
applyPreset(macroButton[b], CALL_MODE_BUTTON_PRESET);
|
||||
}
|
||||
|
||||
@ -43,7 +42,6 @@ void longPressAction(uint8_t b)
|
||||
case 1: bri += 8; stateUpdated(CALL_MODE_BUTTON); buttonPressedTime[b] = millis(); break; // repeatable action
|
||||
}
|
||||
} else {
|
||||
unloadPlaylist(); // applying a preset unloads the playlist
|
||||
applyPreset(macroLongPress[b], CALL_MODE_BUTTON_PRESET);
|
||||
}
|
||||
|
||||
@ -65,7 +63,6 @@ void doublePressAction(uint8_t b)
|
||||
case 1: ++effectPalette %= strip.getPaletteCount(); colorUpdated(CALL_MODE_BUTTON); break;
|
||||
}
|
||||
} else {
|
||||
unloadPlaylist(); // applying a preset unloads the playlist
|
||||
applyPreset(macroDoublePress[b], CALL_MODE_BUTTON_PRESET);
|
||||
}
|
||||
|
||||
|
@ -184,7 +184,6 @@ void handleE131Packet(e131_packet_t* p, IPAddress clientIP, byte protocol){
|
||||
// only apply preset if not in playlist, or playlist changed
|
||||
(currentPlaylist < 0 || dmxValPreset != currentPlaylist)) {
|
||||
presetCycCurr = dmxValPreset;
|
||||
unloadPlaylist(); // applying a preset unloads the playlist
|
||||
applyPreset(dmxValPreset, CALL_MODE_NOTIFICATION);
|
||||
}
|
||||
|
||||
|
@ -442,13 +442,11 @@ bool deserializeState(JsonObject root, byte callMode, byte presetId)
|
||||
currentPreset = root[F("pd")] | currentPreset;
|
||||
if (root["win"].isNull()) presetCycCurr = currentPreset; // otherwise it was set in handleSet() [set.cpp]
|
||||
presetToRestore = currentPreset; // stateUpdated() will clear the preset, so we need to restore it after
|
||||
//unloadPlaylist(); // applying a preset unloads the playlist, may be needed here too?
|
||||
} else if (!root["ps"].isNull()) {
|
||||
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)
|
||||
return stateResponse;
|
||||
}
|
||||
|
@ -399,7 +399,6 @@ void checkTimers()
|
||||
&& isTodayInDateRange(((timerMonth[i] >> 4) & 0x0F), timerDay[i], timerMonth[i] & 0x0F, timerDayEnd[i])
|
||||
)
|
||||
{
|
||||
unloadPlaylist();
|
||||
applyPreset(timerMacro[i]);
|
||||
}
|
||||
}
|
||||
@ -413,7 +412,6 @@ void checkTimers()
|
||||
&& (timerWeekday[8] & 0x01) //timer is enabled
|
||||
&& ((timerWeekday[8] >> weekdayMondayFirst()) & 0x01)) //timer should activate at current day of week
|
||||
{
|
||||
unloadPlaylist();
|
||||
applyPreset(timerMacro[8]);
|
||||
DEBUG_PRINTF_P(PSTR("Sunrise macro %d triggered."),timerMacro[8]);
|
||||
}
|
||||
@ -428,7 +426,6 @@ void checkTimers()
|
||||
&& (timerWeekday[9] & 0x01) //timer is enabled
|
||||
&& ((timerWeekday[9] >> weekdayMondayFirst()) & 0x01)) //timer should activate at current day of week
|
||||
{
|
||||
unloadPlaylist();
|
||||
applyPreset(timerMacro[9]);
|
||||
DEBUG_PRINTF_P(PSTR("Sunset macro %d triggered."),timerMacro[9]);
|
||||
}
|
||||
|
@ -119,6 +119,7 @@ void initPresetsFile()
|
||||
|
||||
bool applyPreset(byte index, byte callMode)
|
||||
{
|
||||
unloadPlaylist(); // applying a preset unloads the playlist (#3827)
|
||||
DEBUG_PRINT(F("Request to apply preset: "));
|
||||
DEBUG_PRINTLN(index);
|
||||
presetToApply = index;
|
||||
|
@ -108,7 +108,6 @@ static void setOff() {
|
||||
|
||||
void presetWithFallback(uint8_t presetID, uint8_t effectID, uint8_t paletteID) {
|
||||
resetNightMode();
|
||||
unloadPlaylist();
|
||||
applyPresetWithFallback(presetID, CALL_MODE_BUTTON_PRESET, effectID, paletteID);
|
||||
}
|
||||
|
||||
|
@ -883,7 +883,6 @@ bool handleSet(AsyncWebServerRequest *request, const String& req, bool apply)
|
||||
|
||||
//apply preset
|
||||
if (updateVal(req.c_str(), "PL=", &presetCycCurr, presetCycMin, presetCycMax)) {
|
||||
unloadPlaylist();
|
||||
applyPreset(presetCycCurr);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user