mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Raise ConditionError for numeric_state errors (#45923)
This commit is contained in:
committed by
GitHub
parent
9e07910ab0
commit
b9b1caf4d7
@@ -162,18 +162,20 @@ async def test_trigger_service_ignoring_condition(hass, calls):
|
||||
"alias": "test",
|
||||
"trigger": [{"platform": "event", "event_type": "test_event"}],
|
||||
"condition": {
|
||||
"condition": "state",
|
||||
"condition": "numeric_state",
|
||||
"entity_id": "non.existing",
|
||||
"state": "beer",
|
||||
"above": "1",
|
||||
},
|
||||
"action": {"service": "test.automation"},
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
hass.bus.async_fire("test_event")
|
||||
await hass.async_block_till_done()
|
||||
assert len(calls) == 0
|
||||
with patch("homeassistant.components.automation.LOGGER.warning") as logwarn:
|
||||
hass.bus.async_fire("test_event")
|
||||
await hass.async_block_till_done()
|
||||
assert len(calls) == 0
|
||||
assert len(logwarn.mock_calls) == 1
|
||||
|
||||
await hass.services.async_call(
|
||||
"automation", "trigger", {"entity_id": "automation.test"}, blocking=True
|
||||
|
||||
Reference in New Issue
Block a user