1
mirror of https://github.com/home-assistant/frontend synced 2024-09-30 15:52:53 +02:00

Support shorthand logical operators in script sequences (#12509)

This commit is contained in:
Franck Nijhof 2022-04-29 16:47:44 +02:00 committed by GitHub
parent 671c8e387f
commit 3438912ba5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -294,7 +294,7 @@ export const getActionType = (action: Action): ActionType => {
if ("wait_template" in action) {
return "wait_template";
}
if ("condition" in action) {
if (["condition", "and", "or", "not"].some((key) => key in action)) {
return "check_condition";
}
if ("event" in action) {

View File

@ -65,6 +65,9 @@ const getType = (action: Action | undefined) => {
if ("service" in action || "scene" in action) {
return getActionType(action);
}
if (["and", "or", "not"].some((key) => key in action)) {
return "condition";
}
return OPTIONS.find((option) => option in action);
};