mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Convert some test helpers to coroutines and adjust tests (#23352)
* Convert some test helpers to coroutines * Fix tests
This commit is contained in:
committed by
Martin Hjelmare
parent
86b017e2f0
commit
5376e15286
@@ -301,30 +301,26 @@ async def test_service_calls(hass):
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert hass.states.get('light.light_group').state == 'on'
|
||||
common.async_toggle(hass, 'light.light_group')
|
||||
await hass.async_block_till_done()
|
||||
await common.async_toggle(hass, 'light.light_group')
|
||||
|
||||
assert hass.states.get('light.bed_light').state == 'off'
|
||||
assert hass.states.get('light.ceiling_lights').state == 'off'
|
||||
assert hass.states.get('light.kitchen_lights').state == 'off'
|
||||
|
||||
common.async_turn_on(hass, 'light.light_group')
|
||||
await hass.async_block_till_done()
|
||||
await common.async_turn_on(hass, 'light.light_group')
|
||||
|
||||
assert hass.states.get('light.bed_light').state == 'on'
|
||||
assert hass.states.get('light.ceiling_lights').state == 'on'
|
||||
assert hass.states.get('light.kitchen_lights').state == 'on'
|
||||
|
||||
common.async_turn_off(hass, 'light.light_group')
|
||||
await hass.async_block_till_done()
|
||||
await common.async_turn_off(hass, 'light.light_group')
|
||||
|
||||
assert hass.states.get('light.bed_light').state == 'off'
|
||||
assert hass.states.get('light.ceiling_lights').state == 'off'
|
||||
assert hass.states.get('light.kitchen_lights').state == 'off'
|
||||
|
||||
common.async_turn_on(hass, 'light.light_group', brightness=128,
|
||||
effect='Random', rgb_color=(42, 255, 255))
|
||||
await hass.async_block_till_done()
|
||||
await common.async_turn_on(hass, 'light.light_group', brightness=128,
|
||||
effect='Random', rgb_color=(42, 255, 255))
|
||||
|
||||
state = hass.states.get('light.bed_light')
|
||||
assert state.state == 'on'
|
||||
|
||||
Reference in New Issue
Block a user