Initial support for parallel
This commit is contained in:
1 parent
50f1d2a42d
commit
d4e2e2f1e5
6 files changed
+50
-1
No files matched your search
@@ -0,0 +1,22 @@
|
||||
import InputYaml from "components/Inputs/InputYaml";
|
||||
import { ParallelAction } from "types/automations/actions";
|
||||
import { OptionManager } from "./OptionManager";
|
||||
|
||||
export const ActionParallelState: OptionManager<ParallelAction> = {
|
||||
defaultState: () => ({
|
||||
alias: "",
|
||||
parallel: [],
|
||||
}),
|
||||
isReady: () => true,
|
||||
Component: ({ state, setState }) => {
|
||||
return (
|
||||
<>
|
||||
<InputYaml
|
||||
label="Actions"
|
||||
value={state.parallel ?? []}
|
||||
onChange={(parallel) => setState({ ...state, parallel })}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
},
|
||||
};
|
||||
@@ -20,6 +20,7 @@ import { TriggerWebhook } from "./TriggerWebhook";
|
||||
import { TriggerZone } from "./TriggerZone";
|
||||
import { TriggerDevice } from "./TriggerDevice";
|
||||
import { ActionStopState } from "./ActionStop";
|
||||
import { ActionParallelState } from "./ActionParallel";
|
||||
|
||||
export const getOptionManager = <T extends AutomationNodeTypes>(
|
||||
nodeType: T,
|
||||
@@ -43,6 +44,8 @@ export const getOptionManager = <T extends AutomationNodeTypes>(
|
||||
return ActionStopState;
|
||||
case "delay":
|
||||
return ActionWaitState;
|
||||
case "parallel":
|
||||
return ActionParallelState;
|
||||
}
|
||||
}
|
||||
if (nodeType === "condition") {
|
||||
|
||||
Reference in new issue
Block a user