Fix BEGA color temp channel unsupported check#737
Fix BEGA color temp channel unsupported check#737TheJulianJES wants to merge 2 commits intozigpy:devfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #737 +/- ##
=======================================
Coverage 97.63% 97.63%
=======================================
Files 62 62
Lines 10814 10814
=======================================
Hits 10558 10558
Misses 256 256 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR fixes BEGA “Color temperature channel” select entity creation by treating the feature as unsupported when either of the two reported switchable color temperature attributes is 0xFFFF, preventing the select entity from being created on single-channel (“dimmable only”) BEGA lights.
Changes:
- Update BEGA select entity support check to skip entity creation when
switchable_color_temperature_1or_2equals0xFFFF. - Adjust debug log message to match the new condition.
- Expand test coverage to ensure the select entity is not created when either (or both) temp attributes are
0xFFFF.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
zha/application/platforms/select.py |
Fixes _is_supported() logic for BEGA color temp channel select creation. |
tests/test_select.py |
Adds parametrized test cases covering partial-unsupported (0xFFFF) scenarios. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Proposed change
This fixes an issue where the "Color temperature channel" select entity for BEGA lights was created, even if the light driver only supports one color temperature channel. On truly "dimmable only" lights with one driver channel only, one attribute still has the correct color temperature (e.g. 3000K), with the other one being set to
0xFFFF.To fix this, we just do not create the select entity if either driver channel's color temperature is
0xFFFF.Additional information
Follow-up to:
To note again: These lights are not tunable color temperature lights. They can only be fixed to either 3000K or 4000K (depends on exact model). So, this cannot be represented in the Home Assistant light entity model and an extra select entity is needed to switch the driver channel. See the above PR for more notes on this.