Revert Hue color state to be xy-based (#14154)
This commit is contained in:
parent
aa8bd37143
commit
30d987f59f
2 changed files with 1 additions and 17 deletions
|
@ -245,12 +245,9 @@ class HueLight(Light):
|
|||
mode = self._color_mode
|
||||
source = self.light.action if self.is_group else self.light.state
|
||||
|
||||
if mode == 'xy' and 'xy' in source:
|
||||
if mode in ('xy', 'hs'):
|
||||
return color.color_xy_to_hs(*source['xy'])
|
||||
|
||||
if mode == 'hs' and 'hue' in source and 'sat' in source:
|
||||
return source['hue'] / 65535 * 360, source['sat'] / 255 * 100
|
||||
|
||||
return None
|
||||
|
||||
@property
|
||||
|
|
|
@ -650,19 +650,6 @@ def test_hs_color():
|
|||
|
||||
assert light.hs_color is None
|
||||
|
||||
light = hue_light.HueLight(
|
||||
light=Mock(state={
|
||||
'colormode': 'hs',
|
||||
'hue': 1234,
|
||||
'sat': 123,
|
||||
}),
|
||||
request_bridge_update=None,
|
||||
bridge=Mock(),
|
||||
is_group=False,
|
||||
)
|
||||
|
||||
assert light.hs_color == (1234 / 65535 * 360, 123 / 255 * 100)
|
||||
|
||||
light = hue_light.HueLight(
|
||||
light=Mock(state={
|
||||
'colormode': 'xy',
|
||||
|
|
Loading…
Add table
Reference in a new issue