Add modbus light brightness and color temperature
This pull request introduces support for brightness and color temperature adjustments through switches. Previously, these functionalities were unavailable or required alternative implementations. Now, users can control brightness and color temperature directly using dedicated switches.
Breaking change
Proposed change
Added brightness control support. Implemented color temperature adjustments. Updated relevant logic to integrate these features with existing switch mechanisms. Ensured compatibility with the current Modbus setup in Home Assistant. Testing: Verified brightness adjustments work correctly through the switch. Tested color temperature changes to ensure seamless integration. Checked backward compatibility to avoid breaking existing functionality. Let me know if you need any modifications!
Type of change
- [ ] Dependency upgrade
- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New integration (thank you!)
- [x] New feature (which adds functionality to an existing integration)
- [ ] Deprecation (breaking change to happen in the future)
- [ ] Breaking change (fix/feature causing existing functionality to break)
- [ ] Code quality improvements to existing code or addition of tests
Additional information
- This PR fixes or closes issue: fixes #
- This PR is related to issue:
- Link to documentation pull request: https://github.com/home-assistant/home-assistant.io/pull/37973
- Link to developer documentation pull request:
- Link to frontend pull request:
Checklist
- [x] The code change is tested and works locally.
- [x] Local tests pass. Your PR cannot be merged unless tests pass
- [x] There is no commented out code in this PR.
- [x] I have followed the development checklist
- [x] I have followed the perfect PR recommendations
- [x] The code has been formatted using Ruff (
ruff format homeassistant tests) - [x] Tests have been added to verify that the new code works.
If user exposed functionality or configuration variables are added/changed:
- [x] Documentation added/updated for www.home-assistant.io
If the code communicates with devices, web services, or third-party tools:
- [ ] The manifest file has all fields filled out correctly.
Updated and included derived files by running:python3 -m script.hassfest. - [ ] New or updated dependencies have been added to
requirements_all.txt.
Updated by runningpython3 -m script.gen_requirements_all. - [ ] For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
To help with the load of incoming pull requests:
- [x] I have reviewed two other open pull requests in this repository.
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks :+1:
I have some issues with documentation. Here is documentation for new functions but i don`t know how to find and update old modbus documentation for light
I have some issues with documentation. Here is documentation for new functions but i don`t know how to find and update old modbus documentation for light
You have to fork the next branch of the home-assistant.io repo and make a PR, then you can link the PR to this one.
Moreoever.. format the code following ruff guidelines.
Hi! I missed something for review or all is good?
Hey @DioSWolF ruff seems to be failing. Can you sort out? Please do mark the PR as Ready after fixing that by pressing the "Ready for review" button here on github. Thanks!
Hey @DioSWolF , the CI is still failing. I really recommend that you setup the pre-commit hook or run it manually: https://developers.home-assistant.io/docs/development_testing/#preventing-linter-errors
Here local pre-commit tests results
test_color_temp_light is failing
Moreover, the coverage of the light.py is only 94%. Lines 127 to 134 are not covered and they have been added by your PR, so they should be validated.
Before you take over PR, I learn a lot of things that I never noticed before in my work.π
And added WSL for Windows PC and updated it to use Python 3.13 and now i know how to work with itπ
Thank you @abmantis !