Prefer device_type over cluster/attribute values for Light#703
Prefer device_type over cluster/attribute values for Light#703
device_type over cluster/attribute values for Light#703Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #703 +/- ##
==========================================
- Coverage 97.51% 97.48% -0.04%
==========================================
Files 62 62
Lines 10946 10954 +8
==========================================
+ Hits 10674 10678 +4
- Misses 272 276 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Interestingly, there is not a single device in our testing database that uses a color device type (or a color temperature device type) without also having a color cluster! I would have thought this to not be the case but it looks like manufacturers use the device type pretty strictly compared to clusters themselves. |
7a46db7 to
914b77d
Compare
|
I've added the |
TheJulianJES
left a comment
There was a problem hiding this comment.
This is definitely useful, but I fear we'll break some lights. For a patch release, that's not great.
The main HA issue is that the light gets into a state where color_mode is set to XY (or HS?), even though that is not part of the supported color modes. As far as I can see, this can only ever happen during polling.
The initialization/capabilities set color_mode based on the supported ones, so that should be fine. For an alternative approach that just fixes polling for a patch release, see:
There was a problem hiding this comment.
Checking Z2M and official instructions, the Sengled Z01-A19NAE26 does support color temperature. This patch now changes that to "brightness only". I imagine at least other Sengled lights will be affected as well.
This is a test PR to potentially address home-assistant/core#164598 (comment).
I've added the affected devices to our test database and have regenerated diagnostics, showing what devices would be affected if we use the device type more aggressively. I haven't tested the changes yet but this affects very few devices.