1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Allow is_state to accept a list of values (#81877)

* Allow is_state to accept a list of values

* Slightly more efficient

* Fix typing of state

Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
Mike Degatano
2022-11-30 16:54:14 -05:00
committed by GitHub
parent e158546425
commit b3deb476ef
2 changed files with 12 additions and 2 deletions

View File

@@ -1389,6 +1389,14 @@ def test_is_state(hass: HomeAssistant) -> None:
)
assert tpl.async_render() == "test.object"
tpl = template.Template(
"""
{{ is_state("test.object", ["on", "off", "available"]) }}
""",
hass,
)
assert tpl.async_render() is True
def test_is_state_attr(hass: HomeAssistant) -> None:
"""Test is_state_attr method."""