mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-25 05:47:20 +00:00
Fix script graph parallel (#12545)
This commit is contained in:
parent
f0c7232704
commit
e99143139e
@ -34,6 +34,7 @@ import {
|
||||
DeviceAction,
|
||||
EventAction,
|
||||
IfAction,
|
||||
ManualScriptConfig,
|
||||
ParallelAction,
|
||||
RepeatAction,
|
||||
SceneAction,
|
||||
@ -478,7 +479,20 @@ export class HatScriptGraph extends LitElement {
|
||||
nofocus
|
||||
></hat-graph-node>
|
||||
${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>
|
||||
`;
|
||||
|
@ -214,7 +214,7 @@ export interface StopAction extends BaseAction {
|
||||
}
|
||||
|
||||
export interface ParallelAction extends BaseAction {
|
||||
parallel: Action | Action[];
|
||||
parallel: ManualScriptConfig | Action | (ManualScriptConfig | Action)[];
|
||||
}
|
||||
|
||||
interface UnknownAction extends BaseAction {
|
||||
|
@ -185,7 +185,11 @@ export const getDataFromPath = (
|
||||
const asNumber = Number(raw);
|
||||
|
||||
if (isNaN(asNumber)) {
|
||||
result = result[raw];
|
||||
const tempResult = result[raw];
|
||||
if (!tempResult && raw === "sequence") {
|
||||
continue;
|
||||
}
|
||||
result = tempResult;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user