mirror of
https://github.com/home-assistant/core.git
synced 2025-12-25 05:26:47 +00:00
Improve precision of Hue color state (#14113)
This commit is contained in:
committed by
Pascal Vizeli
parent
9d1f9fe204
commit
0b350993b5
@@ -237,7 +237,7 @@ async def test_lights(hass, mock_bridge):
|
||||
assert lamp_1 is not None
|
||||
assert lamp_1.state == 'on'
|
||||
assert lamp_1.attributes['brightness'] == 144
|
||||
assert lamp_1.attributes['hs_color'] == (71.896, 83.137)
|
||||
assert lamp_1.attributes['hs_color'] == (36.067, 69.804)
|
||||
|
||||
lamp_2 = hass.states.get('light.hue_lamp_2')
|
||||
assert lamp_2 is not None
|
||||
@@ -253,7 +253,7 @@ async def test_lights_color_mode(hass, mock_bridge):
|
||||
assert lamp_1 is not None
|
||||
assert lamp_1.state == 'on'
|
||||
assert lamp_1.attributes['brightness'] == 144
|
||||
assert lamp_1.attributes['hs_color'] == (71.896, 83.137)
|
||||
assert lamp_1.attributes['hs_color'] == (36.067, 69.804)
|
||||
assert 'color_temp' not in lamp_1.attributes
|
||||
|
||||
new_light1_on = LIGHT_1_ON.copy()
|
||||
@@ -668,19 +668,6 @@ def test_hs_color():
|
||||
'colormode': 'xy',
|
||||
'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',
|
||||
'hue': None,
|
||||
'sat': 123,
|
||||
'xy': [0.4, 0.5]
|
||||
}),
|
||||
request_bridge_update=None,
|
||||
|
||||
Reference in New Issue
Block a user