Analog button fix#5659
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)
WalkthroughThis PR changes the Button Action Presets UI to be button-type-aware: it adds helpers to generate analog-specific options and to detect button types, updates the default preset label to “Default Action (0)”, extends addRow(...) to accept a button type and render per-type selectors, and updates getSettingsJS() to emit the new double-press and type arguments. ChangesAnalog Button Type Support
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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: 1
🤖 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_time.htm`:
- Around line 309-311: The label "Double press (n/a)" is misleading because the
select named "MD${b}" is actually hydrated from button.macroDoublePress in
wled00/xml.cpp; either rename the label to "Double press" to reflect it's
functional or make the control non-editable/disabled if the firmware still
ignores the value. Update the HTML in settings_time.htm to change the <label>
text for the select with name "MD${b}" (or add the disabled attribute/class) and
ensure consistency with the button.macroDoublePress usage in wled00/xml.cpp so
the UI accurately represents whether the value is applied.
🪄 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: 8bec5088-0633-4560-b48a-0fece4a75f8f
📒 Files selected for processing (2)
wled00/data/settings_time.htmwled00/xml.cpp
| buttonBlock.innerHTML = ` | ||
| <div class="bh">Button ${i} - ${typeName}</div> | ||
| <div class="bs"> | ||
| <input type="hidden" name="MP${b}" value="0"> |
There was a problem hiding this comment.
do we require the hidden values? i.e. they are set to default zero in firmware if missing, see set.cpp
| if (t===undefined) t = 0; | ||
| var b = String.fromCharCode((i<10?48:55)+i); | ||
| var presetOpts = '<option value="0">Default Action</option>' + sortedPresetOptions; | ||
| var analog = isAnalogBtn(t); |
There was a problem hiding this comment.
single use variable adds code for no benefit
|
thanks, looks good to me, just two minor things. edit: |
|
I agree. I didn't want to scope creep the PR, but had thought of making the labels dynamic. |

This fixes the issues noted in #5613 (comment)
This also adds clarification for the differences between analog and digital inputs. Showing and hiding dropdowns as needed to make those selections clearer.
Summary by CodeRabbit
Release Notes