Skip to content

When selecting LED GPIO the grayed options can be locked as the "-" button is clicked. #5772

In review

Description

@UsableLoki8221

What happened?

If I select a GPIO on number 2 section of LED outputs and then click the "-" button the GPIO will continue to be locked in the drop down for the first section. When the "+" button is click it reverts to "unused" but the number initially set is still grayed and thus locked.

To Reproduce Bug

^

Expected Behavior

GPIO becomes available to select again after clicking "-".

Install Method

Self-Compiled

What version of WLED?

WLED 17.0.0-devV5 (2607201)

Which microcontroller/board are you seeing the problem on?

ESP32-C3

Relevant log/trace output

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. UsableLoki8221 commented on Aug 5, 2026

    @UsableLoki8221
    Author

    I believe this issue can be expanded when a button is added/removed as well.

  2. DedeHai commented on Aug 6, 2026

    @DedeHai
    Collaborator

    known issue, I fixed this already in #5704 but may be worth backporting to 16.x so I'll keep this open as a reminder.

  3. added
    confirmed
    on Aug 6, 2026
  4. added this to the 16.1 milestone on Aug 6, 2026
  5. softhack007 commented on Dec 2, 2026

    @softhack007
    Member

    @DedeHai do you still plan to backport the settings page fix to 16.1 ?

  6. DedeHai commented on Dec 3, 2026

    @DedeHai
    Collaborator

    @coderabbitai since upstream has a lot of changes to the LED settings page, can the fix still be backported to 16_x?

  7. coderabbitai commented on Dec 3, 2026

    @coderabbitai
    Contributor
    Analysis chain

    Script executed:

    #!/bin/bash
    set -u
    echo '=== Issue #5772 ==='
    gh api repos/wled/WLED/issues/5772 --jq '{title,body,state,html_url}'
    echo '=== Issue comments ==='
    gh api --paginate repos/wled/WLED/issues/5772/comments --jq '.[] | {user:.user.login,body,created_at}'
    echo '=== PR #5704 ==='
    gh api repos/wled/WLED/pulls/5704 --jq '{title,body,state,merged_at,merge_commit_sha,base:.base.ref,head:.head.ref,commits,changed_files,html_url}'
    echo '=== PR changed files ==='
    gh api --paginate 'repos/wled/WLED/pulls/5704/files?per_page=100' --jq '.[] | {filename,status,additions,deletions}'
    echo '=== Branch refs ==='
    git branch -a
    echo '=== Remote default ==='
    git remote -v

    Length of output: 11817


    Script executed:

    #!/bin/bash
    set -u
    echo '=== 16_x branch metadata ==='
    gh api repos/wled/WLED/branches/16_x --jq '{name,sha:.commit.sha}' || true
    echo '=== Fetch 16_x for read-only comparison ==='
    git fetch --no-tags origin 16_x 2>&1
    echo '=== Main file outline ==='
    ast-grep outline wled00/data/settings_leds.htm --items all 2>&1 | head -100
    echo '=== 16_x file availability and size ==='
    git show FETCH_HEAD:wled00/data/settings_leds.htm > /tmp/wled-settings-leds-16x.htm && wc -l /tmp/wled-settings-leds-16x.htm
    echo '=== 16_x GPIO and row function locations ==='
    rg -n -i -C 2 'function |gpio|pin|remove|addled|addbutton' /tmp/wled-settings-leds-16x.htm | head -350
    echo '=== main GPIO and row function locations ==='
    rg -n -i -C 2 'function |gpio|pin|remove|addled|addbutton' wled00/data/settings_leds.htm | head -350
    echo '=== PR patch for settings_leds.htm ==='
    gh api --paginate 'repos/wled/WLED/pulls/5704/files?per_page=100' --jq '.[] | select(.filename=="wled00/data/settings_leds.htm") | .patch' > /tmp/wled-settings-leds-pr5704.patch
    wc -lc /tmp/wled-settings-leds-pr5704.patch
    rg -n -i -C 6 'gpio|pin|remove|addled|addbutton' /tmp/wled-settings-leds-pr5704.patch | head -500

    Length of output: 54432


    Script executed:

    #!/bin/bash
    set -u
    git fetch --no-tags origin 16_x >/dev/null 2>&1
    echo '=== 16_x source paths ==='
    git ls-tree -r --name-only FETCH_HEAD | rg '(^|/)(settings_leds\.htm|common\.js|pin_manager\.h)$'
    git show FETCH_HEAD:wled00/data/settings_leds.htm > /tmp/wled-16x-leds.htm
    echo '=== 16_x addLEDs ==='
    cat -n /tmp/wled-16x-leds.htm | sed -n '533,627p'
    echo '=== 16_x button management ==='
    cat -n /tmp/wled-16x-leds.htm | sed -n '683,725p'
    echo '=== 16_x dropdown and pin update ==='
    cat -n /tmp/wled-16x-leds.htm | sed -n '810,910p'
    echo '=== main equivalent removal and pin update ==='
    cat -n wled00/data/settings_leds.htm | sed -n '745,773p;830,875p;985,1066p'
    echo '=== common.js outline and pin functions ==='
    fd -a '^common\.js$' | head -10
    ast-grep outline wled00/data/common.js --items all --match 'Pin|pin' 2>&1 | head -100
    git show FETCH_HEAD:wled00/data/common.js > /tmp/wled-16x-common.js
    rg -n -C 5 'function (fetchPinInfo|makePinSelect|unmakePinSelect)|pinsData|pinUpd' /tmp/wled-16x-common.js
    echo '=== pin owner enum on 16_x ==='
    git show FETCH_HEAD:wled00/pin_manager.h > /tmp/wled-16x-pin-manager.h
    rg -n -C 5 'enum|Button|Relay|IR|Led|LED|0x8' /tmp/wled-16x-pin-manager.h | head -180
    echo '=== off() callers on 16_x ==='
    rg -n -C 2 '\boff\(' /tmp/wled-16x-leds.htm

    Length of output: 32346


    @DedeHai Yes. A selective backport looks feasible; the Pixel Bus driver changes are not needed.

    On 16_x, addLEDs() removes the output row without releasing its cached GPIOs. The branch has the same dropdown and pin-cache structures used by the fix in #5704.

    I would port the GPIO-related changes in wled00/data/settings_leds.htm rather than cherry-pick the full PR:

    • Add formOwner() and freePin(), and release the old pin in pinUpd().
    • Release pins before removing an LED output or button, then rebuild the dropdowns.
    • Update off() so clearing a button, IR, or relay pin also releases it.

    The backport should check virtual outputs and HUB75 fields carefully, so numeric values that are not GPIOs do not release unrelated pins. It should also test that reserved and other occupied pins remain unavailable.

    This assessment is based on source comparison. I did not run a browser or hardware test.


    Learnings used

    Learnt from: softhack007
    Repo: wled/WLED PR: 0
    File: :0-0
    Timestamp: 2026-10-03T14:59:43.661Z
    Learning: In wled/WLED, softhack007 prefers contributors to answer maintainer questions directly with short explanations in their own words, even if the explanations are technically imprecise or the English is imperfect. Contributors should state uncertainty and actual test results rather than relay unverified AI-generated technical answers. AI may assist with translation or wording, but should not manufacture explanations that shift fact-checking and AI-session supervision onto maintainers.
    

    You are interacting with an AI system.

  8. removed this from the 16.1 milestone on Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugconfirmed

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions