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:
@@ -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."""
|
||||
|
||||
Reference in New Issue
Block a user