mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Fix ZHA Light color conversion. (#22909)
This commit is contained in:
parent
75bed93d3d
commit
64ea13104e
@ -29,6 +29,7 @@ class ColorChannel(ZigbeeChannel):
|
||||
async def async_configure(self):
|
||||
"""Configure channel."""
|
||||
await self.fetch_color_capabilities(False)
|
||||
await super().async_configure()
|
||||
|
||||
async def async_initialize(self, from_cache):
|
||||
"""Initialize channel."""
|
||||
|
@ -266,7 +266,9 @@ class Light(ZhaEntity, light.Light):
|
||||
'current_x', from_cache=from_cache)
|
||||
color_y = await self._color_channel.get_attribute_value(
|
||||
'current_y', from_cache=from_cache)
|
||||
self._hs_color = color_util.color_xy_to_hs(color_x, color_y)
|
||||
if color_x is not None and color_y is not None:
|
||||
self._hs_color = color_util.color_xy_to_hs(
|
||||
float(color_x / 65535), float(color_y / 65535))
|
||||
|
||||
async def refresh(self, time):
|
||||
"""Call async_get_state at an interval."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user