mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-17 06:16:33 +00:00
Fix script graph parallel (#12545)
This commit is contained in:
parent
f0c7232704
commit
e99143139e
@ -34,6 +34,7 @@ import {
|
|||||||
DeviceAction,
|
DeviceAction,
|
||||||
EventAction,
|
EventAction,
|
||||||
IfAction,
|
IfAction,
|
||||||
|
ManualScriptConfig,
|
||||||
ParallelAction,
|
ParallelAction,
|
||||||
RepeatAction,
|
RepeatAction,
|
||||||
SceneAction,
|
SceneAction,
|
||||||
@ -478,7 +479,20 @@ export class HatScriptGraph extends LitElement {
|
|||||||
nofocus
|
nofocus
|
||||||
></hat-graph-node>
|
></hat-graph-node>
|
||||||
${ensureArray(node.parallel).map((action, i) =>
|
${ensureArray(node.parallel).map((action, i) =>
|
||||||
this.render_action_node(action, `${path}/parallel/${i}/0`)
|
"sequence" in action
|
||||||
|
? html`<div ?track=${path in this.trace.trace}>
|
||||||
|
${ensureArray((action as ManualScriptConfig).sequence).map(
|
||||||
|
(sAction, j) =>
|
||||||
|
this.render_action_node(
|
||||||
|
sAction,
|
||||||
|
`${path}/parallel/${i}/sequence/${j}`
|
||||||
|
)
|
||||||
|
)}
|
||||||
|
</div>`
|
||||||
|
: this.render_action_node(
|
||||||
|
action,
|
||||||
|
`${path}/parallel/${i}/sequence/0`
|
||||||
|
)
|
||||||
)}
|
)}
|
||||||
</hat-graph-branch>
|
</hat-graph-branch>
|
||||||
`;
|
`;
|
||||||
|
@ -214,7 +214,7 @@ export interface StopAction extends BaseAction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface ParallelAction extends BaseAction {
|
export interface ParallelAction extends BaseAction {
|
||||||
parallel: Action | Action[];
|
parallel: ManualScriptConfig | Action | (ManualScriptConfig | Action)[];
|
||||||
}
|
}
|
||||||
|
|
||||||
interface UnknownAction extends BaseAction {
|
interface UnknownAction extends BaseAction {
|
||||||
|
@ -185,7 +185,11 @@ export const getDataFromPath = (
|
|||||||
const asNumber = Number(raw);
|
const asNumber = Number(raw);
|
||||||
|
|
||||||
if (isNaN(asNumber)) {
|
if (isNaN(asNumber)) {
|
||||||
result = result[raw];
|
const tempResult = result[raw];
|
||||||
|
if (!tempResult && raw === "sequence") {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
result = tempResult;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user