Support UniFi LED control for devices without RGB#156812
Conversation
|
Hey there @Kane610, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for UniFi LED control on devices that only support ON/OFF functionality without RGB capabilities. The implementation differentiates between devices with full LED ring support (RGB + brightness) and devices with basic LED control (ON/OFF only) by checking hardware capabilities.
Key changes:
- Modified device support detection to include devices with
led_overrideattribute - Implemented conditional color mode selection based on
supports_led_ringcapability - Added helper functions for brightness conversion and default value handling
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| homeassistant/components/unifi/light.py | Core logic changes to support both RGB and ON/OFF LED modes with conditional attribute handling |
| tests/components/unifi/test_light.py | Added comprehensive test coverage for ON/OFF-only devices and mode differentiation |
|
aiounifi v88 has been released |
|
@Kane610 could you leave a review please so this PR can be considered for 2025.12? Much appreciated 🤗 |
Proposed change
Introduces conditional control for UniFi network devices which do not support RGB, but only have ON/OFF capabilities.
I've analyzed the obfuscated frontend JS source code of the UniFi controller, however there seems to be no flag related to general LED support.
For future reference I created a Gist with all the Flags: https://gist.github.com/Sese-Schneider/f176e2c801371317522d8943becb19f6 (cc @Kane610)
Based on my understanding of the source code the LED component is shown if the device has the attribute
led_override.I chose the same condition to enable ON/OFF LED control.
Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: