mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-26 22:37:21 +00:00
Support shorthand logical operators in script sequences (#12509)
This commit is contained in:
parent
671c8e387f
commit
3438912ba5
@ -294,7 +294,7 @@ export const getActionType = (action: Action): ActionType => {
|
|||||||
if ("wait_template" in action) {
|
if ("wait_template" in action) {
|
||||||
return "wait_template";
|
return "wait_template";
|
||||||
}
|
}
|
||||||
if ("condition" in action) {
|
if (["condition", "and", "or", "not"].some((key) => key in action)) {
|
||||||
return "check_condition";
|
return "check_condition";
|
||||||
}
|
}
|
||||||
if ("event" in action) {
|
if ("event" in action) {
|
||||||
|
@ -65,6 +65,9 @@ const getType = (action: Action | undefined) => {
|
|||||||
if ("service" in action || "scene" in action) {
|
if ("service" in action || "scene" in action) {
|
||||||
return getActionType(action);
|
return getActionType(action);
|
||||||
}
|
}
|
||||||
|
if (["and", "or", "not"].some((key) => key in action)) {
|
||||||
|
return "condition";
|
||||||
|
}
|
||||||
return OPTIONS.find((option) => option in action);
|
return OPTIONS.find((option) => option in action);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user