mirror of
https://github.com/wled/WLED.git
synced 2025-04-24 06:47:18 +00:00
Merge branch '0_15' into GitHub-Actions
This commit is contained in:
commit
213f45494f
@ -36,7 +36,7 @@ marshmallow==3.19.0
|
||||
# via platformio
|
||||
packaging==23.1
|
||||
# via marshmallow
|
||||
platformio==6.1.6
|
||||
platformio==6.1.14
|
||||
# via -r requirements.in
|
||||
pyelftools==0.29
|
||||
# via platformio
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
@ -1984,7 +1984,7 @@ function makeP(i,pl)
|
||||
<div class="sel">End preset:<br>
|
||||
<div class="sel-p"><select class="sel-ple" id="pl${i}selEnd" onchange="plR(${i})" data-val=${plJson[i].end?plJson[i].end:0}>
|
||||
<option value="0">None</option>
|
||||
<option value="255">Restore preset</option>
|
||||
<option value="255" ${plJson[i].end && plJson[i].end==255?"selected":""}>Restore preset</option>
|
||||
${makePlSel(plJson[i].end?plJson[i].end:0, true)}
|
||||
</select></div></div>
|
||||
</div>
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
|
@ -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<playlistLen; i++) {
|
||||
ps.add(playlistEntries[i].preset);
|
||||
|
@ -117,6 +117,15 @@ void initPresetsFile()
|
||||
f.close();
|
||||
}
|
||||
|
||||
bool applyPresetFromPlaylist(byte index)
|
||||
{
|
||||
DEBUG_PRINT(F("Request to apply preset: "));
|
||||
DEBUG_PRINTLN(index);
|
||||
presetToApply = index;
|
||||
callModeToApply = CALL_MODE_DIRECT_CHANGE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool applyPreset(byte index, byte callMode)
|
||||
{
|
||||
unloadPlaylist(); // applying a preset unloads the playlist (#3827)
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
// version code in format yymmddb (b = daily build)
|
||||
#define VERSION 2403190
|
||||
#define VERSION 2403220
|
||||
|
||||
//uncomment this if you have a "my_config.h" file you'd like to use
|
||||
//#define WLED_USE_MY_CONFIG
|
||||
|
Loading…
x
Reference in New Issue
Block a user