From a8ae7059a28e991ccbdf9e6eb6c5c994842c6fff Mon Sep 17 00:00:00 2001
From: aeoa <64489515+aeoa@users.noreply.github.com>
Date: Wed, 3 Jun 2026 22:02:54 +0200
Subject: [PATCH 1/8] Add clocked playlist scheduling
---
wled00/const.h | 1 +
wled00/data/index.js | 32 +++++++++++++-
wled00/playlist.cpp | 103 +++++++++++++++++++++++++++++++++++++++++++
3 files changed, 134 insertions(+), 2 deletions(-)
diff --git a/wled00/const.h b/wled00/const.h
index 70373316fd..f5e431928e 100644
--- a/wled00/const.h
+++ b/wled00/const.h
@@ -448,6 +448,7 @@ static_assert(WLED_MAX_BUSSES <= 32, "WLED_MAX_BUSSES exceeds hard limit");
//Playlist option byte
#define PL_OPTION_SHUFFLE 0x01
#define PL_OPTION_RESTORE 0x02
+#define PL_OPTION_CLOCKED 0x04
// Segment capability byte
#define SEG_CAPABILITY_RGB 0x01
diff --git a/wled00/data/index.js b/wled00/data/index.js
index ee5126973c..4de8b99c0f 100644
--- a/wled00/data/index.js
+++ b/wled00/data/index.js
@@ -2008,6 +2008,7 @@ function plR(p)
{
var pl = plJson[p];
pl.r = gId(`pl${p}rtgl`).checked;
+ pl.clocked = gId(`pl${p}clocked`).checked;
if (gId(`pl${p}rptgl`).checked) { // infinite
pl.repeat = 0;
delete pl.end;
@@ -2019,6 +2020,25 @@ function plR(p)
}
}
+function plClock(p)
+{
+ const clocked = gId(`pl${p}clocked`).checked;
+ const manual = gId(`pl${p}manual`);
+ if (clocked && manual.checked) {
+ manual.checked = false;
+ plM(p);
+ } else if (clocked) {
+ plJson[p].dur.forEach((e,i)=>{
+ if (e > 0) return;
+ plJson[p].dur[i] = 100;
+ const d = gId(`pl${p}du${i}`);
+ if (d) d.value = 10;
+ });
+ }
+ manual.disabled = clocked;
+ plR(p);
+}
+
function plM(p)
{
const man = gId(`pl${p}manual`).checked;
@@ -2041,17 +2061,24 @@ function makeP(i,pl)
transition: [tr],
repeat: 0,
r: false,
+ clocked: false,
end: 0
};
const rep = plJson[i].repeat ? plJson[i].repeat : 0;
- const man = plJson[i].dur == 0;
+ const clocked = !!plJson[i].clocked;
+ if (clocked) plJson[i].dur = plJson[i].dur.map(d => d > 0 ? d : 100);
+ const man = !clocked && plJson[i].dur.every(d => d == 0);
content =
`
+