Open TheJulianJES opened 3 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 94.18%. Comparing base (
8fc3aba
) to head (82332f2
). Report is 2 commits behind head on dev.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
(Somewhat unfinished for now, see bottom. Already "works" if two lines are deleted from HA.)
Proposed change
This removes sending "move to hue/saturation" commands to lights supporting HS when the "always prefer xy mode" option is disabled. By default, it is already disabled.
The config option is now also removed and ZHA only sends XY color commands to color lights. There are no benefits to addressing the light with HS color calls, only downsides:
Do note that HA will convert HS args given to
light.turn_on
to XY colors, as we set "supported color modes" correctly. So, the functionality of being able to set the color of lights via HS colors doesn't break. They just get converted to XY first.Further considerations
The unfinished test
test_zha_group_light_entity
is still unfinished and the HS attribute cache initialization probably doesn't make much sense to test now.This also requires removing the
CONF_ALWAYS_PREFER_XY_COLOR_MODE
option from the ZHA websocket API in HA. I've not checked how HA deals with the fact if somebody has setCONF_ALWAYS_PREFER_XY_COLOR_MODE
toFalse
in their config. If it breaks, we should fix that.. and remove the option from the config.For the few people that (accidentally) disabled the "Always prefer XY color mode" option in ZHA, the state might be shown incorrect in HA until the light is initialized/polled. This should happen shortly after HA startup. Even if the light is in "HS color mode" then, polling will revert the light color mode attribute to XY as expected and use the correct XY values.
more...?
Hence it's a only a draft PR for now.