Skip to content

luci-{base,mod-system}: add support for RGB LEDs#8678

Open
tmacholda wants to merge 2 commits into
openwrt:masterfrom
tmacholda:feature/luci-led-color
Open

luci-{base,mod-system}: add support for RGB LEDs#8678
tmacholda wants to merge 2 commits into
openwrt:masterfrom
tmacholda:feature/luci-led-color

Conversation

@tmacholda

@tmacholda tmacholda commented Jun 4, 2026

Copy link
Copy Markdown

Pull request details

Description

Add support for changing LED brightness and colors in LuCI.

The attributes (color names, maximum and current brightness, etc.) are pulled directly from sysfs (in case of using e.g. CMY instead of RGB) which might hamper translation efforts. It may be worth it to simply hard-code the color names to be RGB for this purpose.

Note: I have written very little JS code overall so there are definitely stupid mistakes in the code.

Screenshot or video of changes (if applicable)

image

Maintainer (preferred)

@feckert


Tested on

OpenWrt version: openwrt 24.10 (r29199+104-d5ac5cdfb2)
LuCI version: LuCI openwrt-24.10 branch (24.297.79519~bcd13b9)
Web browser(s): Firefox 151.0.2-1


Checklist

  • This PR is not from my main or master branch 💩, but a separate branch. ✅
  • Each commit has a valid ✒️ Signed-off-by: <my@email.address> row (via git commit --signoff).
  • Each commit and PR title has a valid 📝 <package name>: title first line subject for packages.
  • Incremented 🆙 any PKG_VERSION in the Makefile.
  • (Optional) Includes what Issue it closes (e.g. openwrt/luci#issue-number).
  • (Optional) Includes what it depends on (e.g. openwrt/packages#pr-number in sister repo).

add color channel attributes to getLEDs ubus call

Signed-off-by: Tomáš Macholda <tomas.macholda@nic.cz>
@tmacholda tmacholda force-pushed the feature/luci-led-color branch from 4d56f36 to 3db14aa Compare June 4, 2026 09:57

@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; the RGB-LED changes wire up cleanly against the in-tree backend — the new brightness and color_<channel> UCI options are read by package/base-files/files/etc/init.d/led (config_get ... color_${color} and config_get brightness), so this is not a frontend-only addition. access() on the rpcd side follows the existing existence-check pattern in the same file. One style nit inline.


Generated by Claude Code

Comment thread modules/luci-mod-system/htdocs/luci-static/resources/view/system/leds.js Outdated
added support for setting LED brightness and colours

channels and max_brightness are pulled dynamically from sysfs

Signed-off-by: Tomáš Macholda <tomas.macholda@nic.cz>
@tmacholda

Copy link
Copy Markdown
Author

related to (but not dependent on) openwrt/openwrt#23670

@tmacholda tmacholda requested a review from openwrt-ai June 5, 2026 17:04

@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 commit; no new issues found. The delta since the last review is the requested style fix (varlet/const and the missing trailing semicolons), which resolves the earlier nit.


Generated by Claude Code

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.

2 participants