Allow any value when triggering on state attribute (#41261)
This commit is contained in:
1 parent
a6d50ba89b
commit
b524cc9c56
5 files changed
+131
-27
No files matched your search
@@ -1240,3 +1240,32 @@ async def test_attribute_if_not_fires_on_entities_change_with_for_after_stop(
|
||||
async_fire_time_changed(hass, dt_util.utcnow() + timedelta(seconds=10))
|
||||
await hass.async_block_till_done()
|
||||
assert len(calls) == 1
|
||||
|
||||
|
||||
async def test_attribute_if_fires_on_entity_change_with_both_filters_boolean(
|
||||
hass, calls
|
||||
):
|
||||
"""Test for firing if both filters are match attribute."""
|
||||
hass.states.async_set("test.entity", "bla", {"happening": False})
|
||||
|
||||
assert await async_setup_component(
|
||||
hass,
|
||||
automation.DOMAIN,
|
||||
{
|
||||
automation.DOMAIN: {
|
||||
"trigger": {
|
||||
"platform": "state",
|
||||
"entity_id": "test.entity",
|
||||
"from": False,
|
||||
"to": True,
|
||||
"attribute": "happening",
|
||||
},
|
||||
"action": {"service": "test.automation"},
|
||||
}
|
||||
},
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
hass.states.async_set("test.entity", "bla", {"happening": True})
|
||||
await hass.async_block_till_done()
|
||||
assert len(calls) == 1
|
||||
Reference in new issue
Block a user