make relay post-switching delay a config parameter#5738
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughAdds a configurable relay-to-LED stabilization delay, exposes it in LED settings, persists it as ChangesConfigurable relay delay
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant settings_leds.htm
participant getSettingsJS
participant handleSettingsSet
participant cfg.cpp
participant handleOnOff
participant LEDs
settings_leds.htm->>getSettingsJS: Display RLD from relayDelay
settings_leds.htm->>handleSettingsSet: Submit RLD
handleSettingsSet->>cfg.cpp: Store relayDelay as relay.del
cfg.cpp-->>settings_leds.htm: Load relay.del into RLD
handleOnOff->>handleOnOff: Wait relayDelay
handleOnOff->>LEDs: Send LED data
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@wled00/data/settings_leds.htm`:
- Line 814: Update the relay-delay assignment in loadCfg() to read the persisted
hw.relay.del configuration key, matching the key written by cfg.json, while
preserving the existing RLD field update behavior.
In `@wled00/set.cpp`:
- Line 311: Clamp or reject relay-delay values to the valid 0..65535 range
before storing them in relayDelay. Update the RLD assignment in
wled00/set.cpp:311 and the relay.del assignment in wled00/cfg.cpp:464,
preserving valid inputs while preventing malformed values from reaching
delay(relayDelay).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 44eb97e5-6f7d-482d-b53d-a54d3b64c0c1
📒 Files selected for processing (7)
wled00/button.cppwled00/cfg.cppwled00/const.hwled00/data/settings_leds.htmwled00/set.cppwled00/wled.hwled00/xml.cpp
Can be set in relay configuration, stored in cfg.
Summary by CodeRabbit
New Features
Bug Fixes