added scene support

This commit is contained in:
ari committed 2022-08-06 22:43:56 -04:00
1 parent 754cc2ef98
commit 6b21734041
6 files changed
+52 -12

No files matched your search

@@ -0,0 +1,21 @@
import InputText from "components/Inputs/Base/InputText";
import { SceneAction } from "types/automations/actions";
import { OptionManager } from "./OptionManager";
export const ActionSceneState: OptionManager<SceneAction> = {
defaultState: () => ({
scene: "",
}),
isReady: () => true,
Component: ({ state, setState }) => {
return (
<>
<InputText
label="Scene"
value={state.scene ?? ""}
onChange={(d) => setState({ ...state, scene: d })}
/>
</>
);
},
};
@@ -22,6 +22,7 @@ import { ActionStopState } from "./ActionStop";
import { ActionParallelState } from "./ActionParallel";
import { TriggerSunState } from "./TriggerSun";
import { TriggerCalendarState } from "./TriggerCalendar";
import { ActionSceneState } from "./ActionScene";
export const getOptionManager = <T extends AutomationNodeTypes>(
nodeType: T,
@@ -41,6 +42,8 @@ export const getOptionManager = <T extends AutomationNodeTypes>(
return ActionCallServiceState;
case "wait":
return ActionWaitState;
case "scene":
return ActionSceneState;
case "stop":
return ActionStopState;
case "delay":