Fix light toggle service attributes (#35483)

This commit is contained in:
Xiaonan Shen authored and GitHub committed 2020-05-11 12:58:59 +02:00
1 parent 823a44cd23
commit 5d8e6d5432
3 files changed
+102 -18

No files matched your search

+9
View File
@@ -263,6 +263,15 @@ class TestLight(unittest.TestCase):
light.ATTR_HS_COLOR: (prof_h, prof_s),
} == data
# Test toggle with parameters
common.toggle(self.hass, ent3.entity_id, profile=prof_name, brightness_pct=100)
self.hass.block_till_done()
_, data = ent3.last_call("turn_on")
assert {
light.ATTR_BRIGHTNESS: 255,
light.ATTR_HS_COLOR: (prof_h, prof_s),
} == data
# Test bad data
common.turn_on(self.hass)
common.turn_on(self.hass, ent1.entity_id, profile="nonexisting")