From b556da8b36ffafefd6f5cef5c0cf18339699ee83 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Sat, 3 Jan 2026 12:19:56 +0100 Subject: [PATCH] Bugfix: GPIO0 always gets assigned to a button (#5259) if button pin arg is missing, it defaults to 0 assigning a button to that pin. This change fixes that. Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: DedeHai <6280424+DedeHai@users.noreply.github.com> --- wled00/set.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wled00/set.cpp b/wled00/set.cpp index 2a633bf0..db8b30ba 100644 --- a/wled00/set.cpp +++ b/wled00/set.cpp @@ -279,7 +279,7 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage) int offset = i < 10 ? '0' : 'A' - 10; char bt[4] = "BT"; bt[2] = offset+i; bt[3] = 0; // button pin (use A,B,C,... if WLED_MAX_BUTTONS>10) char be[4] = "BE"; be[2] = offset+i; be[3] = 0; // button type (use A,B,C,... if WLED_MAX_BUTTONS>10) - int hw_btn_pin = request->arg(bt).toInt(); + int hw_btn_pin = request->hasArg(bt) ? request->arg(bt).toInt() : -1; if (i >= buttons.size()) buttons.emplace_back(hw_btn_pin, request->arg(be).toInt()); // add button to vector else { buttons[i].pin = hw_btn_pin;