Skip to content

luci-mod-system: fix LED configuration form - #9104

Merged
systemcrash merged 3 commits into
openwrt:masterfrom
innovara:led-trigger-default
Nov 16, 2026
Merged

systemcrash merged 3 commits into
openwrt:masterfrom
innovara:led-trigger-default

Conversation

@innovara

@innovara innovara commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Description

Three fixes to the LED configuration form, one commit each. #9105 and #9106 have been folded into this PR as suggested there.

1. Default LED trigger to none

The LED init script falls back to the none trigger when a LED has no trigger option, but LuCI did not apply the same default.

As a result, the edit dialog of such a LED showed whichever trigger was listed first (e.g. Always on (kernel: default-on)), hid the options of the none trigger and, when saved, stored that trigger, changing how the LED behaves. The trigger description was not shown either, even after switching triggers.

LEDs set up with ucidef_set_led_default() or ucidef_set_led_brightness() are current examples, as neither sets a trigger. For instance, stock /etc/config/system on a Linksys MX4200v2:

config led 'led_blue'
	option name 'blue'
	option sysfs 'blue:status'
	option default '1'
	option brightness '51'

Default the trigger to none to match the init script.

Before:

Screenshot From 2026-10-05 13-30-46

After:

Screenshot From 2026-10-05 15-09-30

2. Only show LED interval for netdev trigger

The LED init script only applies the interval option for the netdev trigger, but it was shown for every LED, both in the overview table and in the edit dialog.

Move it to the netdev trigger as a modal-only option depending on trigger=netdev, like the other trigger-specific options.

Before:

Screenshot From 2026-10-05 13-30-16 Screenshot From 2026-10-05 13-30-46

After:

Screenshot From 2026-10-05 15-27-48 Screenshot From 2026-10-05 15-28-35 Screenshot From 2026-10-05 19-52-54

@systemcrash this moves the Interval option you added in 17a2969 into the netdev trigger, as the init script only applies it there. If showing it for every trigger was intentional, let me know.

3. Describe none LED trigger as static

With the none trigger, the LED init script sets the LED on or off according to its default option, but LuCI labelled it Always off and described it as The LED is always in default state off., which contradicts a ticked Default state checkbox.

Label it Static and describe it as The LED stays in the configured default state, on or off.

Before:

Screenshot From 2026-10-05 15-09-30

After:

Screenshot From 2026-10-05 15-40-25

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 new commits; no new issues found.


Generated by Claude Code

@innovara
innovara force-pushed the led-trigger-default branch from 3d64e7a to e565921 Compare October 14, 2026 12:23
@innovara innovara changed the title luci-mod-system: default LED trigger to none luci-mod-system: fix LED configuration form Oct 14, 2026
@innovara

Copy link
Copy Markdown
Contributor Author

@BKPepe as suggested in #9105, #9105 and #9106 are now folded into this PR, one commit each, rebased on current master. Ready for your review.

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 new commits; no new issues found.


Generated by Claude Code

@abajk

abajk commented Nov 12, 2026

Copy link
Copy Markdown
Contributor
Tested-by: Aleksander Jan Bajkowski <olek2@wp.pl>

@innovara
innovara force-pushed the led-trigger-default branch from e565921 to b8270de Compare November 13, 2026 15:36
@innovara

Copy link
Copy Markdown
Contributor Author

@systemcrash the second commit here moves the Interval option you added in 17a2969 into the netdev trigger, as the LED init script only applies it there. Could you confirm showing it for every trigger wasn't intentional?

If you have a moment, a review of the other two commits would be much appreciated too. @abajk has already tested the whole PR.

The LED init script falls back to the "none" trigger when a LED has
no trigger option, but LuCI did not apply the same default.

As a result, the edit dialog of such a LED showed whichever trigger
was listed first, hid the options of the "none" trigger and, when
saved, stored that trigger, changing how the LED behaves. The trigger
description was not shown either, even after switching triggers.

LEDs set up with ucidef_set_led_default() or ucidef_set_led_brightness()
are current examples, as neither sets a trigger.

Default the trigger to "none" to match the init script.

Assisted-by: LLM
Tested-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Signed-off-by: Manuel Fombuena <fombuena@outlook.com>
The LED init script only applies the interval option for the netdev
trigger, but it was shown for every LED, both in the overview table
and in the edit dialog.

Move it to the netdev trigger as a modal-only option depending on
trigger=netdev, like the other trigger-specific options.

Assisted-by: LLM
Tested-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Signed-off-by: Manuel Fombuena <fombuena@outlook.com>
With the "none" trigger, the LED init script sets the LED on or off
according to its default option, but LuCI labelled it "Always off" and
described it as always in default state off, which contradicts a ticked
"Default state" checkbox.

Label it "Static" and describe it as staying in the configured default
state, on or off.

Assisted-by: LLM
Tested-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Signed-off-by: Manuel Fombuena <fombuena@outlook.com>
@innovara
innovara force-pushed the led-trigger-default branch from b8270de to 1b129ce Compare November 13, 2026 16:53
@systemcrash
systemcrash merged commit 41e24e0 into openwrt:master Nov 16, 2026
8 checks passed
@systemcrash

Copy link
Copy Markdown
Contributor

Thanks @innovara !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants