input booleans

This commit is contained in:
Ari Sosnovsky committed 2021-11-02 21:45:15 -04:00
1 parent 70eba32b34
commit 126f1df657
7 files changed
+166 -5

No files matched your search

@@ -1,16 +1,22 @@
import { AutomationNode, AutomationNodeType, NodeSubType } from "../types"
import { BaseState } from "./BaseState"
import { AutomationNodeType, NodeSubType } from "../types"
import ScriptRepeatState from "./ScriptRepeat"
import ScriptCallServiceState from "./ScriptService"
import ScriptWaitState from "./ScriptWait"
export const getBaseState = <T extends AutomationNodeType>(
node_type: T,
node_subtype: NodeSubType<T>
) : any => {
console.log(node_subtype)
if ( node_type === 'action') {
switch (node_subtype) {
case 'Service':
return ScriptCallServiceState
case "Repeat":
return ScriptRepeatState;
case "Wait":
return ScriptWaitState;
}
}
throw new Error(`Invalid or Not implemented node type ${node_type} -> ${node_subtype}`)