Raise ConditionError for time errors (#46250)

This commit is contained in:
Anders Melchiorsen
2021-02-11 17:29:17 +01:00
committed by GitHub
parent 5ce49c62b1
commit 888c9e120d
2 changed files with 11 additions and 4 deletions

View File

@@ -334,8 +334,11 @@ async def test_time_using_input_datetime(hass):
hass, after="input_datetime.pm", before="input_datetime.am"
)
assert not condition.time(hass, after="input_datetime.not_existing")
assert not condition.time(hass, before="input_datetime.not_existing")
with pytest.raises(ConditionError):
condition.time(hass, after="input_datetime.not_existing")
with pytest.raises(ConditionError):
condition.time(hass, before="input_datetime.not_existing")
async def test_if_numeric_state_raises_on_unavailable(hass, caplog):