From 800abc605f615d90d77f82b8b6a108e0b92748b9 Mon Sep 17 00:00:00 2001 From: Shlomo Zippel Date: Thu, 10 Aug 2023 12:52:29 -0700 Subject: [PATCH 1/2] Add send and receive groups to json api --- wled00/json.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wled00/json.cpp b/wled00/json.cpp index c0c72989..bf7ff102 100644 --- a/wled00/json.cpp +++ b/wled00/json.cpp @@ -347,7 +347,9 @@ bool deserializeState(JsonObject root, byte callMode, byte presetId) JsonObject udpn = root["udpn"]; notifyDirect = udpn["send"] | notifyDirect; + syncGroups = udpn["sgrp"] | syncGroups; receiveNotifications = udpn["recv"] | receiveNotifications; + receiveGroups = udpn["rgrp"] | receiveGroups; if ((bool)udpn[F("nn")]) callMode = CALL_MODE_NO_NOTIFY; //send no notification just for this request unsigned long timein = root["time"] | UINT32_MAX; //backup time source if NTP not synced @@ -564,6 +566,8 @@ void serializeState(JsonObject root, bool forPreset, bool includeBri, bool segme JsonObject udpn = root.createNestedObject("udpn"); udpn["send"] = notifyDirect; udpn["recv"] = receiveNotifications; + udpn["sgrp"] = syncGroups; + udpn["rgrp"] = receiveGroups; root[F("lor")] = realtimeOverride; } From bf452e922a92efc08c688da3d5af10c832f36828 Mon Sep 17 00:00:00 2001 From: Blaz Kristan Date: Wed, 16 Aug 2023 22:11:16 +0200 Subject: [PATCH 2/2] Playlist saving bugfix. Fixes #3324 --- wled00/playlist.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wled00/playlist.cpp b/wled00/playlist.cpp index d74ac5a3..8a6227e1 100644 --- a/wled00/playlist.cpp +++ b/wled00/playlist.cpp @@ -112,7 +112,7 @@ int16_t loadPlaylist(JsonObject playlistObj, byte presetId) { if (playlistEndPreset == 255 && currentPreset > 0) playlistEndPreset = currentPreset; if (playlistEndPreset > 250) playlistEndPreset = 0; shuffle = shuffle || playlistObj["r"]; - if (shuffle) playlistOptions += PL_OPTION_SHUFFLE; + if (shuffle) playlistOptions |= PL_OPTION_SHUFFLE; currentPlaylist = presetId; DEBUG_PRINTLN(F("Playlist loaded.")); @@ -156,7 +156,7 @@ void serializePlaylist(JsonObject sObj) { JsonArray ps = playlist.createNestedArray("ps"); JsonArray dur = playlist.createNestedArray("dur"); JsonArray transition = playlist.createNestedArray(F("transition")); - playlist[F("repeat")] = (playlistIndex < 0) ? playlistRepeat - 1 : playlistRepeat; // remove added repetition count (if not yet running) + playlist[F("repeat")] = (playlistIndex < 0 && playlistRepeat > 0) ? playlistRepeat - 1 : playlistRepeat; // remove added repetition count (if not yet running) playlist["end"] = playlistEndPreset; playlist["r"] = playlistOptions & PL_OPTION_SHUFFLE; for (int i=0; i