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 diff --git a/wled00/presets.cpp b/wled00/presets.cpp index fed2c1ed92..a2e2349910 100644 --- a/wled00/presets.cpp +++ b/wled00/presets.cpp @@ -212,6 +212,17 @@ 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() + // (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; + } } //called from handleSet(PS=) [network callback (sObj is empty), IR (irrational), deserializeState, UDP] and deserializeState() [network callback (filedoc!=nullptr)]