zha/light: Properly parse currentX and currentY on async_update() (#14605)

This commit is contained in:
Alexei Chetroi 2018-05-28 10:32:47 -04:00 committed by Paulus Schoutsen
parent 6f4dd7b057
commit 144bb3492a

View File

@ -172,7 +172,8 @@ class Light(zha.Entity, light.Light):
result = await zha.safe_read(self._endpoint.light_color,
['current_x', 'current_y'])
if 'current_x' in result and 'current_y' in result:
xy_color = (result['current_x'], result['current_y'])
xy_color = (round(result['current_x']/65535, 3),
round(result['current_y']/65535, 3))
self._hs_color = color_util.color_xy_to_hs(*xy_color)
@property