mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Fix too green color conversion (#13828)
* Prepare test * Fix too green color conversion * Fix remaining tests
This commit is contained in:
committed by
Paulus Schoutsen
parent
2a5751c09d
commit
9c1bc18def
@@ -29,15 +29,15 @@ class TestDemoLight(unittest.TestCase):
|
||||
def test_state_attributes(self):
|
||||
"""Test light state attributes."""
|
||||
light.turn_on(
|
||||
self.hass, ENTITY_LIGHT, xy_color=(.4, .6), brightness=25)
|
||||
self.hass, ENTITY_LIGHT, xy_color=(.4, .4), brightness=25)
|
||||
self.hass.block_till_done()
|
||||
state = self.hass.states.get(ENTITY_LIGHT)
|
||||
self.assertTrue(light.is_on(self.hass, ENTITY_LIGHT))
|
||||
self.assertEqual((0.378, 0.574), state.attributes.get(
|
||||
self.assertEqual((0.4, 0.4), state.attributes.get(
|
||||
light.ATTR_XY_COLOR))
|
||||
self.assertEqual(25, state.attributes.get(light.ATTR_BRIGHTNESS))
|
||||
self.assertEqual(
|
||||
(207, 255, 0), state.attributes.get(light.ATTR_RGB_COLOR))
|
||||
(255, 234, 164), state.attributes.get(light.ATTR_RGB_COLOR))
|
||||
self.assertEqual('rainbow', state.attributes.get(light.ATTR_EFFECT))
|
||||
light.turn_on(
|
||||
self.hass, ENTITY_LIGHT, rgb_color=(251, 253, 255),
|
||||
@@ -48,7 +48,7 @@ class TestDemoLight(unittest.TestCase):
|
||||
self.assertEqual(
|
||||
(250, 252, 255), state.attributes.get(light.ATTR_RGB_COLOR))
|
||||
self.assertEqual(
|
||||
(0.316, 0.333), state.attributes.get(light.ATTR_XY_COLOR))
|
||||
(0.319, 0.326), state.attributes.get(light.ATTR_XY_COLOR))
|
||||
light.turn_on(self.hass, ENTITY_LIGHT, color_temp=400, effect='none')
|
||||
self.hass.block_till_done()
|
||||
state = self.hass.states.get(ENTITY_LIGHT)
|
||||
|
||||
Reference in New Issue
Block a user