mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 18:28:14 +02:00
Clean up async_reproduce_state helper usage (#68617)
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
"""Test reproduce state for Input datetime."""
|
||||
from homeassistant.core import State
|
||||
from homeassistant.helpers.state import async_reproduce_state
|
||||
|
||||
from tests.common import async_mock_service
|
||||
|
||||
@ -28,7 +29,8 @@ async def test_reproducing_states(hass, caplog):
|
||||
datetime_calls = async_mock_service(hass, "input_datetime", "set_datetime")
|
||||
|
||||
# These calls should do nothing as entities already in desired state
|
||||
await hass.helpers.state.async_reproduce_state(
|
||||
await async_reproduce_state(
|
||||
hass,
|
||||
[
|
||||
State("input_datetime.entity_datetime", "2010-10-10 01:20:00"),
|
||||
State("input_datetime.entity_time", "01:20:00"),
|
||||
@ -39,7 +41,8 @@ async def test_reproducing_states(hass, caplog):
|
||||
assert len(datetime_calls) == 0
|
||||
|
||||
# Test invalid state is handled
|
||||
await hass.helpers.state.async_reproduce_state(
|
||||
await async_reproduce_state(
|
||||
hass,
|
||||
[
|
||||
State("input_datetime.entity_datetime", "not_supported"),
|
||||
State("input_datetime.entity_datetime", "not-valid-date"),
|
||||
@ -55,7 +58,8 @@ async def test_reproducing_states(hass, caplog):
|
||||
assert len(datetime_calls) == 0
|
||||
|
||||
# Make sure correct services are called
|
||||
await hass.helpers.state.async_reproduce_state(
|
||||
await async_reproduce_state(
|
||||
hass,
|
||||
[
|
||||
State("input_datetime.entity_datetime", "2011-10-10 02:20:00"),
|
||||
State("input_datetime.entity_time", "02:20:00"),
|
||||
|
Reference in New Issue
Block a user