Support shorthand logical operators in script sequences (#71022)

This commit is contained in:
Franck Nijhof 2022-04-29 18:06:21 +02:00 committed by GitHub
parent 76d105d0ba
commit 682ac52a20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 118 additions and 1 deletions

View file

@ -1599,7 +1599,7 @@ def determine_script_action(action: dict[str, Any]) -> str:
if CONF_WAIT_TEMPLATE in action:
return SCRIPT_ACTION_WAIT_TEMPLATE
if CONF_CONDITION in action:
if any(key in action for key in (CONF_CONDITION, "and", "or", "not")):
return SCRIPT_ACTION_CHECK_CONDITION
if CONF_EVENT in action: