1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-25 05:26:47 +00:00

Clean up async_reproduce_state helper usage (#68617)

This commit is contained in:
Franck Nijhof
2022-03-24 14:40:54 +01:00
committed by GitHub
parent cbf5b5ead5
commit 8aff8d89d2
22 changed files with 159 additions and 126 deletions

View File

@@ -1,5 +1,6 @@
"""Test reproduce state for input boolean."""
from homeassistant.core import State
from homeassistant.helpers.state import async_reproduce_state
from homeassistant.setup import async_setup_component
@@ -15,7 +16,8 @@ async def test_reproducing_states(hass):
}
},
)
await hass.helpers.state.async_reproduce_state(
await async_reproduce_state(
hass,
[
State("input_boolean.initial_on", "off"),
State("input_boolean.initial_off", "on"),
@@ -26,7 +28,8 @@ async def test_reproducing_states(hass):
assert hass.states.get("input_boolean.initial_off").state == "on"
assert hass.states.get("input_boolean.initial_on").state == "off"
await hass.helpers.state.async_reproduce_state(
await async_reproduce_state(
hass,
[
# Test invalid state
State("input_boolean.initial_on", "invalid_state"),