Reverted currentPlaylist.
This commit is contained in:
parent
bddd22cfab
commit
e682fd07cb
@ -416,7 +416,7 @@ void serializeState(JsonObject root, bool forPreset, bool includeBri, bool segme
|
|||||||
if (errorFlag) {root[F("error")] = errorFlag; errorFlag = ERR_NONE;}
|
if (errorFlag) {root[F("error")] = errorFlag; errorFlag = ERR_NONE;}
|
||||||
|
|
||||||
root[F("ps")] = currentPreset>0 ? currentPreset : -1;
|
root[F("ps")] = currentPreset>0 ? currentPreset : -1;
|
||||||
root[F("pl")] = currentPlaylist>0 ? currentPlaylist : -1;
|
root[F("pl")] = currentPlaylist;
|
||||||
|
|
||||||
usermods.addToJsonState(root);
|
usermods.addToJsonState(root);
|
||||||
|
|
||||||
|
@ -47,8 +47,7 @@ void unloadPlaylist() {
|
|||||||
delete[] playlistEntries;
|
delete[] playlistEntries;
|
||||||
playlistEntries = nullptr;
|
playlistEntries = nullptr;
|
||||||
}
|
}
|
||||||
currentPlaylist = 0;
|
currentPlaylist = playlistIndex = -1;
|
||||||
playlistIndex = -1;
|
|
||||||
playlistLen = playlistEntryDur = playlistOptions = 0;
|
playlistLen = playlistEntryDur = playlistOptions = 0;
|
||||||
DEBUG_PRINTLN(F("Playlist unloaded."));
|
DEBUG_PRINTLN(F("Playlist unloaded."));
|
||||||
}
|
}
|
||||||
@ -120,7 +119,7 @@ int16_t loadPlaylist(JsonObject playlistObj, byte presetId) {
|
|||||||
|
|
||||||
void handlePlaylist() {
|
void handlePlaylist() {
|
||||||
static unsigned long presetCycledTime = 0;
|
static unsigned long presetCycledTime = 0;
|
||||||
if (!currentPlaylist || playlistEntries == nullptr) return;
|
if (currentPlaylist<0 || playlistEntries == nullptr) return;
|
||||||
|
|
||||||
if (millis() - presetCycledTime > (100*playlistEntryDur)) {
|
if (millis() - presetCycledTime > (100*playlistEntryDur)) {
|
||||||
presetCycledTime = millis();
|
presetCycledTime = millis();
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// version code in format yymmddb (b = daily build)
|
// version code in format yymmddb (b = daily build)
|
||||||
#define VERSION 2110070
|
#define VERSION 2110071
|
||||||
|
|
||||||
//uncomment this if you have a "my_config.h" file you'd like to use
|
//uncomment this if you have a "my_config.h" file you'd like to use
|
||||||
//#define WLED_USE_MY_CONFIG
|
//#define WLED_USE_MY_CONFIG
|
||||||
@ -513,7 +513,7 @@ WLED_GLOBAL byte timerWeekday[] _INIT_N(({ 255, 255, 255, 255, 255, 255, 255, 25
|
|||||||
WLED_GLOBAL bool blynkEnabled _INIT(false);
|
WLED_GLOBAL bool blynkEnabled _INIT(false);
|
||||||
|
|
||||||
//playlists
|
//playlists
|
||||||
WLED_GLOBAL byte currentPlaylist _INIT(0);
|
WLED_GLOBAL int16_t currentPlaylist _INIT(-1);
|
||||||
//still used for "PL=~" HTTP API command
|
//still used for "PL=~" HTTP API command
|
||||||
WLED_GLOBAL byte presetCycCurr _INIT(0);
|
WLED_GLOBAL byte presetCycCurr _INIT(0);
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ void XML_response(AsyncWebServerRequest *request, char* dest)
|
|||||||
oappend(SET_F("</ws><ps>"));
|
oappend(SET_F("</ws><ps>"));
|
||||||
oappendi(currentPreset);
|
oappendi(currentPreset);
|
||||||
oappend(SET_F("</ps><cy>"));
|
oappend(SET_F("</ps><cy>"));
|
||||||
oappendi(currentPlaylist > 0);
|
oappendi(currentPlaylist >= 0);
|
||||||
oappend(SET_F("</cy><ds>"));
|
oappend(SET_F("</cy><ds>"));
|
||||||
oappend(serverDescription);
|
oappend(serverDescription);
|
||||||
if (realtimeMode)
|
if (realtimeMode)
|
||||||
|
Loading…
Reference in New Issue
Block a user