Skip to content

Fix BEGA color temp channel unsupported check#737

Open
TheJulianJES wants to merge 2 commits intozigpy:devfrom
TheJulianJES:tjj/bega_fix_dimmable_only_select
Open

Fix BEGA color temp channel unsupported check#737
TheJulianJES wants to merge 2 commits intozigpy:devfrom
TheJulianJES:tjj/bega_fix_dimmable_only_select

Conversation

@TheJulianJES
Copy link
Copy Markdown
Contributor

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.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.63%. Comparing base (696ab1c) to head (bae74e8).
⚠️ Report is 3 commits behind head on dev.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TheJulianJES TheJulianJES marked this pull request as ready for review April 4, 2026 20:11
Copilot AI review requested due to automatic review settings April 4, 2026 20:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_1 or _2 equals 0xFFFF.
  • 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.

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