Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions _codeql_detected_source_root
11 changes: 11 additions & 0 deletions wled00/presets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down