From c62705268cae914a5687ca5ecdda6430aae4002d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 24 Jan 2026 14:07:18 +0000 Subject: [PATCH 1/4] Initial plan From 0d5d08e40a9be1c720be7f3c697a95c514810c76 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 24 Jan 2026 14:14:19 +0000 Subject: [PATCH 2/4] Fix relay not switching on at boot when boot preset has on:true Co-authored-by: DedeHai <6280424+DedeHai@users.noreply.github.com> --- wled00/presets.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/wled00/presets.cpp b/wled00/presets.cpp index fed2c1ed92..bddc76852c 100644 --- a/wled00/presets.cpp +++ b/wled00/presets.cpp @@ -212,6 +212,15 @@ void handlePresets() if (changePreset) notify(tmpMode); // force UDP notification stateUpdated(tmpMode); // was colorUpdated() if anything breaks updateInterfaces(tmpMode); + + // Fix for boot preset with relay: ensure relay state is correct after boot preset is applied + if (tmpMode == CALL_MODE_INIT && rlyPin >= 0 && bri > 0 && offMode) { + // Boot preset turned LEDs on, but relay might not have been updated yet + // Force relay on immediately instead of waiting for handleIO() + pinMode(rlyPin, rlyOpenDrain ? OUTPUT_OPEN_DRAIN : OUTPUT); + digitalWrite(rlyPin, rlyMde); + offMode = false; + } } //called from handleSet(PS=) [network callback (sObj is empty), IR (irrational), deserializeState, UDP] and deserializeState() [network callback (filedoc!=nullptr)] From b481e8598767fa036caf8cdea760acd04f2444f2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 24 Jan 2026 14:20:09 +0000 Subject: [PATCH 3/4] Add delay and comment to boot preset relay fix Co-authored-by: DedeHai <6280424+DedeHai@users.noreply.github.com> --- wled00/presets.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wled00/presets.cpp b/wled00/presets.cpp index bddc76852c..a2e2349910 100644 --- a/wled00/presets.cpp +++ b/wled00/presets.cpp @@ -217,8 +217,10 @@ void handlePresets() if (tmpMode == CALL_MODE_INIT && rlyPin >= 0 && bri > 0 && offMode) { // Boot preset turned LEDs on, but relay might not have been updated yet // Force relay on immediately instead of waiting for handleIO() + // (Similar relay control logic exists in handleIO(), but we need it here for the boot case) pinMode(rlyPin, rlyOpenDrain ? OUTPUT_OPEN_DRAIN : OUTPUT); digitalWrite(rlyPin, rlyMde); + delay(50); // wait for relay to switch and power to stabilize offMode = false; } } From a51c3cf8b3df764c7daf54ec4074bd54f6800012 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 24 Jan 2026 14:20:45 +0000 Subject: [PATCH 4/4] Final validation complete Co-authored-by: DedeHai <6280424+DedeHai@users.noreply.github.com> --- _codeql_detected_source_root | 1 + 1 file changed, 1 insertion(+) create mode 120000 _codeql_detected_source_root diff --git a/_codeql_detected_source_root b/_codeql_detected_source_root new file mode 120000 index 0000000000..945c9b46d6 --- /dev/null +++ b/_codeql_detected_source_root @@ -0,0 +1 @@ +. \ No newline at end of file