From 54e628481c138fbbe08020fcee785938ddd7d765 Mon Sep 17 00:00:00 2001 From: Ari Sosnovsky Date: Tue, 14 Dec 2021 15:56:07 -0500 Subject: [PATCH] moved old state handler code --- webapp/src/components/Inputs/styles.ts | 1 - .../NodeEditor/OptionManager/ActionChoose.tsx | 40 ++++++ .../NodeEditor/OptionManager/ActionDevice.tsx | 53 ++++++++ .../OptionManager/ActionService.tsx | 44 +++++++ .../OptionManager/BaseOptionManager.ts | 36 ++++++ .../OptionManager/ConditionLogic.tsx | 51 ++++++++ .../OptionManager/ConditionNumericState.tsx | 52 ++++++++ .../NodeEditor/OptionManager/Generic.tsx | 14 +++ .../NodeEditor/OptionManager/ScriptEvent.tsx | 39 ++++++ .../NodeEditor/OptionManager/ScriptRepeat.tsx | 39 ++++++ .../NodeEditor/OptionManager/ScriptWait.tsx | 44 +++++++ .../OptionManager/getOptionManager.ts | 36 ++++++ .../NodeEditor/OptionManager/index.ts | 114 ++++++++++++++++++ webapp/src/components/NodeEditor/constants.ts | 17 ++- .../components/NodeEditor/index.stories.tsx | 25 +++- webapp/src/components/NodeEditor/index.tsx | 74 ++++++------ webapp/src/components/NodeEditor/styles.ts | 1 + webapp/src/types/automations/index.ts | 14 ++- webapp/src/types/automations/triggers.ts | 3 +- 19 files changed, 642 insertions(+), 55 deletions(-) create mode 100644 webapp/src/components/NodeEditor/OptionManager/ActionChoose.tsx create mode 100644 webapp/src/components/NodeEditor/OptionManager/ActionDevice.tsx create mode 100644 webapp/src/components/NodeEditor/OptionManager/ActionService.tsx create mode 100644 webapp/src/components/NodeEditor/OptionManager/BaseOptionManager.ts create mode 100644 webapp/src/components/NodeEditor/OptionManager/ConditionLogic.tsx create mode 100644 webapp/src/components/NodeEditor/OptionManager/ConditionNumericState.tsx create mode 100644 webapp/src/components/NodeEditor/OptionManager/Generic.tsx create mode 100644 webapp/src/components/NodeEditor/OptionManager/ScriptEvent.tsx create mode 100644 webapp/src/components/NodeEditor/OptionManager/ScriptRepeat.tsx create mode 100644 webapp/src/components/NodeEditor/OptionManager/ScriptWait.tsx create mode 100644 webapp/src/components/NodeEditor/OptionManager/getOptionManager.ts create mode 100644 webapp/src/components/NodeEditor/OptionManager/index.ts diff --git a/webapp/src/components/Inputs/styles.ts b/webapp/src/components/Inputs/styles.ts index 7bf0ca0..cd1da2c 100644 --- a/webapp/src/components/Inputs/styles.ts +++ b/webapp/src/components/Inputs/styles.ts @@ -21,7 +21,6 @@ const commonInputStyle = (theme: AppTheme) => ({ "&:disabled": { backgroundColor: '#403f3f', borderColor: '#403f3f', - color: '#403f3faa', cursor: 'not-allowed', }, } diff --git a/webapp/src/components/NodeEditor/OptionManager/ActionChoose.tsx b/webapp/src/components/NodeEditor/OptionManager/ActionChoose.tsx new file mode 100644 index 0000000..d524603 --- /dev/null +++ b/webapp/src/components/NodeEditor/OptionManager/ActionChoose.tsx @@ -0,0 +1,40 @@ +import InputYaml from "components/Inputs/InputYaml"; +import InputText from "components/Inputs/InputText"; +import { ChooseAction } from "types/automations/actions"; +import { BaseOptionManager, updateActionData } from './BaseOptionManager'; + + +export default class ActionChooseState extends BaseOptionManager { + defaultState = () => ({ + $smType: 'action', + action: 'choose', + action_data: { + alias: "Choose", + default: [], + choose: [], + } + } as ChooseAction) + isReady(state: ChooseAction): boolean { + return state.action_data.alias !== '' + } + renderOptionList(state: ChooseAction): JSX.Element { + const update = updateActionData(state, this.setState); + return
+ update({ alias })} + /> + update({ choose })} + /> + update({ default: d })} + /> +
+ } +} diff --git a/webapp/src/components/NodeEditor/OptionManager/ActionDevice.tsx b/webapp/src/components/NodeEditor/OptionManager/ActionDevice.tsx new file mode 100644 index 0000000..f71bbe9 --- /dev/null +++ b/webapp/src/components/NodeEditor/OptionManager/ActionDevice.tsx @@ -0,0 +1,53 @@ +import InputText from "components/Inputs/InputText"; +import { DeviceAction } from "types/automations/actions"; +import { BaseOptionManager, updateActionData } from './BaseOptionManager'; + + +export default class ActionDeviceState extends BaseOptionManager { + defaultState = () => ({ + $smType: 'action', + action: 'device', + action_data: { + alias: "Device", + type: "", + entity_id: "", + device_id: "", + domain: "", + } + } as DeviceAction) + isReady(state: DeviceAction): boolean { + return state.action_data.alias !== '' && + state.action_data.type !== "" && + state.action_data.entity_id !== "" && + state.action_data.device_id !== "" && + state.action_data.domain !== "" + } + renderOptionList(state: DeviceAction): JSX.Element { + const update = updateActionData(state, this.setState); + return
+ update({ alias })} + /> + update({ device_id })} + /> + update({ type })} + /> + update({ entity_id, domain: entity_id.split('.')[0] })} + /> +
+ } +} diff --git a/webapp/src/components/NodeEditor/OptionManager/ActionService.tsx b/webapp/src/components/NodeEditor/OptionManager/ActionService.tsx new file mode 100644 index 0000000..1e8640c --- /dev/null +++ b/webapp/src/components/NodeEditor/OptionManager/ActionService.tsx @@ -0,0 +1,44 @@ +import InputText from "components/Inputs/InputText"; +import { ServiceAction } from "types/automations/actions"; +import { BaseOptionManager, updateActionData } from './BaseOptionManager'; + + +export default class ActionCallServiceState extends BaseOptionManager { + defaultState = () => ({ + $smType: 'action', + action: 'service', + action_data: { + service: "", + target: "", + data: {}, + } + } as ServiceAction) + isReady(state: ServiceAction): boolean { + const { service, alias, target } = state.action_data; + return service !== '' && + alias !== '' && + target !== '' + } + renderOptionList(state: ServiceAction): JSX.Element { + const { service, alias = "", target } = state.action_data; + const update = updateActionData(state, this.setState); + return
+ update({ alias })} + /> + update({ service })} + /> + update({ target })} + /> +
+ } +} diff --git a/webapp/src/components/NodeEditor/OptionManager/BaseOptionManager.ts b/webapp/src/components/NodeEditor/OptionManager/BaseOptionManager.ts new file mode 100644 index 0000000..0e2b08f --- /dev/null +++ b/webapp/src/components/NodeEditor/OptionManager/BaseOptionManager.ts @@ -0,0 +1,36 @@ +import { AutomationAction } from 'types/automations/actions'; +import { AutomationCondition } from 'types/automations/conditions'; +export abstract class BaseOptionManager { + abstract defaultState(): T ; + abstract isReady(s: T): boolean; + abstract renderOptionList(s: T): JSX.Element; + + constructor(public setState: (s: T) => void) { } +} + + +export const updateConditionData = ( + setState: (s: T) => void +) => ( + state: T, + data: Partial, +) => setState({ + ...state, + condition_data: { + ...state.condition_data, + ...data, + }, +}) + +export const updateActionData = ( + state: T, + setState: (s: T) => void +) => ( + data: Partial, +) => setState({ + ...state, + action_data: { + ...state.action_data, + ...data, + }, +}) diff --git a/webapp/src/components/NodeEditor/OptionManager/ConditionLogic.tsx b/webapp/src/components/NodeEditor/OptionManager/ConditionLogic.tsx new file mode 100644 index 0000000..897da83 --- /dev/null +++ b/webapp/src/components/NodeEditor/OptionManager/ConditionLogic.tsx @@ -0,0 +1,51 @@ +import InputYaml from "components/Inputs/InputYaml"; +import InputText from "components/Inputs/InputText"; +import { BaseOptionManager } from "./BaseOptionManager"; +import { LogicCondition } from "types/automations/conditions"; +import InputList from "components/Inputs/InputList"; + + +export default class ConditionLogicState extends BaseOptionManager { + defaultState = () => ({ + $smType: 'condition', + condition: 'and', + condition_data: { + alias: "", + conditions: [], + } + } as LogicCondition) + isReady(state: LogicCondition): boolean { + const { alias, conditions } = state.condition_data; + return alias !== '' && + conditions?.length > 0; + } + renderOptionList(state: LogicCondition): JSX.Element { + const { alias = "", conditions } = state.condition_data; + return
+ this.setState({ + ...state, condition_data: { + alias: a, conditions + } + })} + /> + this.setState({ ...state, condition })} + /> + this.setState({ + ...state, condition_data: { + alias, conditions: c + } + })} + /> +
+ } +} diff --git a/webapp/src/components/NodeEditor/OptionManager/ConditionNumericState.tsx b/webapp/src/components/NodeEditor/OptionManager/ConditionNumericState.tsx new file mode 100644 index 0000000..91e3d77 --- /dev/null +++ b/webapp/src/components/NodeEditor/OptionManager/ConditionNumericState.tsx @@ -0,0 +1,52 @@ +import InputText from "components/Inputs/InputText"; +import { BaseOptionManager, updateConditionData } from './BaseOptionManager'; +import { NumericCondition } from "types/automations/conditions"; + + +export default class ConditionNumStateState extends BaseOptionManager { + defaultState = () => ({ + $smType: 'condition', + condition_data: { + alias: "", + entity_id: '', + // above: '', + // below: '', + // attribute: '', + value_template: '', + }, + condition: 'numeric_state', + } as NumericCondition) + isReady(state: NumericCondition): boolean { + const { alias, entity_id, value_template } = state.condition_data; + return alias !== '' && + entity_id !== '' && + value_template !== ''; + } + renderOptionList(state: NumericCondition): JSX.Element { + const { alias = "", entity_id, value_template } = state.condition_data; + return
+ updateConditionData(this.setState)(state, { + alias + })} + /> + updateConditionData(this.setState)(state, { + entity_id + })} + /> + updateConditionData(this.setState)(state, { + value_template + })} + /> +
+ } +} diff --git a/webapp/src/components/NodeEditor/OptionManager/Generic.tsx b/webapp/src/components/NodeEditor/OptionManager/Generic.tsx new file mode 100644 index 0000000..46e8fac --- /dev/null +++ b/webapp/src/components/NodeEditor/OptionManager/Generic.tsx @@ -0,0 +1,14 @@ +import { BaseOptionManager } from "./BaseOptionManager"; + + +export default class Generic extends BaseOptionManager { + defaultState = () => ({}) + isReady(state: any): boolean { + return true; + } + renderOptionList(state: any): JSX.Element { + return
+ THIS IS NOT SUPPORTED YET! +
+ } +} diff --git a/webapp/src/components/NodeEditor/OptionManager/ScriptEvent.tsx b/webapp/src/components/NodeEditor/OptionManager/ScriptEvent.tsx new file mode 100644 index 0000000..e5b0887 --- /dev/null +++ b/webapp/src/components/NodeEditor/OptionManager/ScriptEvent.tsx @@ -0,0 +1,39 @@ +import InputBoolean from "../../components/InputBoolean"; +import InputYaml from "../../components/InputYaml"; +import InputNumber from "../../components/InputNumber"; +import InputText from "../../components/InputText"; +import { FireEventScript } from "../types/script"; +import { BaseOptionManager } from "./BaseOptionManager"; + + +export default class ScriptEventState extends BaseOptionManager { + defaultState = () => ({ + alias: "Fire Event", + event: "", + event_data: {}, + }) + isReady(state: FireEventScript): boolean { + return state.alias !== '' && + state.event !== "" + } + renderOptionList(state: FireEventScript): JSX.Element { + return
+ this.setState({ ...state, alias })} + /> + this.setState({ ...state, event })} + /> + this.setState({ ...state, event_data })} + /> +
+ } +} diff --git a/webapp/src/components/NodeEditor/OptionManager/ScriptRepeat.tsx b/webapp/src/components/NodeEditor/OptionManager/ScriptRepeat.tsx new file mode 100644 index 0000000..31d32c8 --- /dev/null +++ b/webapp/src/components/NodeEditor/OptionManager/ScriptRepeat.tsx @@ -0,0 +1,39 @@ +import InputNumber from "../../components/InputNumber"; +import InputText from "../../components/InputText"; +import InputYaml from "../../components/InputYaml"; +import { RepeatScript } from "../types/script"; +import { BaseOptionManager } from "./BaseOptionManager"; + + +export default class ScriptRepeatState extends BaseOptionManager { + defaultState = () => ({ + alias: "Repeat", + repeat: { + count: 1, + sequence: [], + } + }) + isReady(state: RepeatScript): boolean { + return state.alias !== '' && + state?.repeat?.sequence.length > 0 + } + renderOptionList(state: RepeatScript): JSX.Element { + return
+ this.setState({ ...state, alias })} + /> + this.setState({ ...state, repeat: { ...state.repeat, count } })} + /> + this.setState({ ...state, repeat: { ...state.repeat, sequence } })} + /> +
+ } +} diff --git a/webapp/src/components/NodeEditor/OptionManager/ScriptWait.tsx b/webapp/src/components/NodeEditor/OptionManager/ScriptWait.tsx new file mode 100644 index 0000000..a01aa3a --- /dev/null +++ b/webapp/src/components/NodeEditor/OptionManager/ScriptWait.tsx @@ -0,0 +1,44 @@ +import InputBoolean from "../../components/InputBoolean"; +import InputNumber from "../../components/InputNumber"; +import InputText from "../../components/InputText"; +import { WaitScript } from "../types/script"; +import { BaseOptionManager } from "./BaseOptionManager"; + + +export default class ScriptWaitState extends BaseOptionManager { + defaultState = () => ({ + alias: "Wait", + wait_template: "", + timeout: 0, + continue_on_timeout: false, + }) + isReady(state: WaitScript): boolean { + return state.alias !== '' && + state.wait_template !== "" + } + renderOptionList(state: WaitScript): JSX.Element { + return
+ this.setState({ ...state, alias })} + /> + this.setState({ ...state, wait_template })} + /> + this.setState({ ...state, timeout })} + /> + this.setState({ ...state, continue_on_timeout })} + /> +
+ } +} diff --git a/webapp/src/components/NodeEditor/OptionManager/getOptionManager.ts b/webapp/src/components/NodeEditor/OptionManager/getOptionManager.ts new file mode 100644 index 0000000..7e8d045 --- /dev/null +++ b/webapp/src/components/NodeEditor/OptionManager/getOptionManager.ts @@ -0,0 +1,36 @@ +import { AutomationNodeTypes, AutomationNodeSubtype, AutomationNode } from "types/automations" +import ActionChooseState from "./ActionChoose"; +import ActionDeviceState from "./ActionDevice"; +import ActionCallServiceState from "./ActionService" +import { BaseOptionManager } from "./BaseOptionManager"; +import Generic from "./Generic"; + + +export const getOptionManager = ( + nodeType: T, + nodeSubtype: AutomationNodeSubtype, +) : any => { + if ( nodeType === 'action') { + switch (nodeSubtype) { + case 'service': + return ActionCallServiceState; + // case "Repeat": + // return ScriptRepeatState; + // case "Wait": + // return ScriptWaitState; + // case "Event": + // return ScriptEventState; + case "device": + return ActionDeviceState; + case "choose": + return ActionChooseState; + } + } + // if (nodeType === 'condition') { + // switch (nodeSubtype) { + // case 'Logic': + // return ConditionLogicState + // } + // } + return Generic +} diff --git a/webapp/src/components/NodeEditor/OptionManager/index.ts b/webapp/src/components/NodeEditor/OptionManager/index.ts new file mode 100644 index 0000000..0878377 --- /dev/null +++ b/webapp/src/components/NodeEditor/OptionManager/index.ts @@ -0,0 +1,114 @@ +import { useState } from 'react'; +import { AutomationNode, AutomationNodeTypes } from 'types/automations'; +import { AutomationNodeSubtype } from 'types/automations'; +import { BaseOptionManager } from './BaseOptionManager'; +import { getOptionManager } from './getOptionManager'; + + +export const useEditorNodeState = (node: AutomationNode) => { + const [state, setState] = useState(node); + const nodeType: AutomationNodeTypes = state.$smType ?? 'trigger'; + const subType: AutomationNodeSubtype = + state.$smType === 'action' ? state.action : + state.$smType === 'condition' ? state.condition : + state.platform; + const optionManager: BaseOptionManager = new (getOptionManager(nodeType, subType as any))(setState); + return { + nodeType, + subType, + renderOptionList() { + return optionManager.renderOptionList(state); + }, + isReady() { + return optionManager.isReady(state); + }, + get subTypes(): AutomationNodeSubtype[] { + switch (nodeType) { + case 'action': + return [ + "service", + "repeat", + "wait", + "device", + "choose", + ] + case "condition": + return [ + 'or', + 'and', + 'not', + 'numeric_state', + 'state', + 'template', + 'time', + 'trigger', + 'zone', + ] + case 'trigger': + return [ + 'event', + 'homeassistant', + 'mqtt', + 'numeric_state', + 'state', + 'tag', + 'template', + 'time', + 'time_pattern', + 'webhook', + 'zone', + 'device', + ] + default: + return []; + } + }, + + setNodeType(newType: AutomationNodeTypes) { + if (newType === (node.$smType ?? 'trigger')) { + if (node.$smType === 'action') { + setState({ + ...state, + $smType: 'action', + action: node.action + } as any) + } else if (node.$smType === 'condition') { + setState({ + ...state, + $smType: 'condition', + condition: node.condition + } as any) + } else { + setState({ + ...state, + $smType: undefined, + platform: node.platform + } as any) + } + } else { + setState({ + ...state, + $smType: newType === 'trigger' ? undefined : newType, + } as any) + } + }, + setSubType(newSubType: AutomationNodeSubtype) { + if (state.$smType === 'action') { + setState({ + ...state, + action: newSubType, + } as any) + } else if (state.$smType === 'condition') { + setState({ + ...state, + condition: newSubType, + } as any) + } else { + setState({ + ...state, + platform: newSubType, + } as any) + } + } + } +} diff --git a/webapp/src/components/NodeEditor/constants.ts b/webapp/src/components/NodeEditor/constants.ts index be2f6b4..4118199 100644 --- a/webapp/src/components/NodeEditor/constants.ts +++ b/webapp/src/components/NodeEditor/constants.ts @@ -1,4 +1,5 @@ import { AutomationNodeSubtype, AutomationNodeTypes } from "types/automations"; +import { AutomationNode } from '../../types/automations/index'; const actionTypes = [ @@ -39,15 +40,25 @@ const triggerTypes = [ export const getSubTypeList = ( nodeType: T -): AutomationNodeSubtype[] => { +): Array| 'condition'> => { if (nodeType === 'action') { return actionTypes as any; } else if (nodeType === 'condition') { return conditionTypes as any; } else if (nodeType === 'trigger') { return triggerTypes as any; - } else if (nodeType === 'sequence') { - return actionTypes.concat(conditionTypes) as any; } return []; } + +export const getNodeSubType = ( + node: AutomationNode +): AutomationNodeSubtype => { + if (node.$smType === 'action') { + return node.action as any; + } else if(node.$smType === 'condition') { + return node.condition as any; + } else { + return node.platform as any; + } +} diff --git a/webapp/src/components/NodeEditor/index.stories.tsx b/webapp/src/components/NodeEditor/index.stories.tsx index c9b168d..eeb727e 100644 --- a/webapp/src/components/NodeEditor/index.stories.tsx +++ b/webapp/src/components/NodeEditor/index.stories.tsx @@ -8,15 +8,30 @@ export default { title: 'NodeEditor', component: NodeEditor, parameters: { actions: { argTypesRegex: '^on.*' } }, - args: { - nodeType: 'sequence', - subType: 'and', - } + args: {} } as ComponentMeta -export const Basic: ComponentStory = props => { +const Base: ComponentStory = props => { const { classes } = usePageTheme({}); return
}; +export const Action = Base.bind({}) +Action.args = { + ...Action.args, + node: { + $smType: 'action', + action: 'service', + action_data: { + 'data': {}, + 'service': '', + 'target': '', + } + } +} +export const SingleOption = Action.bind({}) +SingleOption.args = { + ...Action.args, + allowedTypes: ['action'], +} diff --git a/webapp/src/components/NodeEditor/index.tsx b/webapp/src/components/NodeEditor/index.tsx index 2fa53a2..7f7ac32 100644 --- a/webapp/src/components/NodeEditor/index.tsx +++ b/webapp/src/components/NodeEditor/index.tsx @@ -1,56 +1,50 @@ -import { Button } from "components/Inputs/Button"; -import { useState, useEffect } from "react"; -import { AutomationNodeTypes, AutomationNode, AutomationNodeSubtype } from "types/automations"; -import { useNodeEditorStyles } from './styles'; -import { getSubTypeList } from './constants'; + +import { FC } from "react"; +import { useNodeEditorStyles } from "./styles"; +import { AutomationNode, AutomationNodeMapping } from 'types/automations/index'; +import { useEditorNodeState } from "./OptionManager"; import InputList from "components/Inputs/InputList"; +import { Button } from "components/Inputs/Button"; -export interface Props { - nodeType: T, - subType: AutomationNodeSubtype, - onClose: () => void, - onUpdate: (node: AutomationNode[T]) => void, + + + +export interface Props { + node: AutomationNode + allowedTypes?: Array; } -export function NodeEditor({ - nodeType, - subType, - onClose, - onUpdate, -}: Props) { - const { classes } = useNodeEditorStyles({}); - const currentSubTypeList = getSubTypeList(nodeType); - const [selectedSubType, setSubType] = useState(subType); - // const stateManager = new StateManager(node_type, selectedSubType); - // useEffect(() => { - // if (stateManager.nodeType !== node_type || stateManager.nodeSubtype !== selectedSubType) { - // stateManager.swapBaseState(node_type, selectedSubType) - // } - // }, [node_type, selectedSubType]); +export const NodeEditor: FC = ({ + node, + allowedTypes = ["action", "condition", "trigger"] +}) => { + const { classes } = useNodeEditorStyles({}); + const state = useEditorNodeState(node); return
-
onClose()}>
-
e.preventDefault()}> +
+
- Create {nodeType[0].toUpperCase()}{nodeType.slice(1)} +
+ {allowedTypes.length > 1 ? : {state.nodeType}} - {/*{stateManager.renderOptionList()} */} + {state.renderOptionList()}
- - + +
diff --git a/webapp/src/components/NodeEditor/styles.ts b/webapp/src/components/NodeEditor/styles.ts index 0b00026..281cb7a 100644 --- a/webapp/src/components/NodeEditor/styles.ts +++ b/webapp/src/components/NodeEditor/styles.ts @@ -43,6 +43,7 @@ export const useNodeEditorStyles = createAppUseStyles<{ color: theme.secondaryAccent, }, body: { + overflow: 'auto', flexGrow: 1 }, footer: { diff --git a/webapp/src/types/automations/index.ts b/webapp/src/types/automations/index.ts index be2c5bf..b9a126e 100644 --- a/webapp/src/types/automations/index.ts +++ b/webapp/src/types/automations/index.ts @@ -16,17 +16,21 @@ export interface AutomationData { sequence: AutomationSequenceNode[]; } export type AutomationSequenceNode = AutomationAction | AutomationCondition; -type AutomationNodeMapping = { +export type AutomationNodeMapping = { "trigger": AutomationTrigger; "action": AutomationAction; "condition": AutomationCondition; - "sequence": AutomationSequenceNode; } -export type AutomationNodeTypes = keyof AutomationNodeMapping; -export type AutomationNode = AutomationNodeMapping[N]; +export type AutomationNodeTypes = keyof AutomationNodeMapping | undefined; +export type AutomationNode = + N extends undefined ? AutomationTrigger : + N extends 'trigger' ? AutomationTrigger : + N extends 'action' ? AutomationAction : + N extends 'condition' ? AutomationCondition : + never; export type AutomationNodeSubtype = + T extends undefined ? TriggerType : T extends 'trigger' ? TriggerType : T extends 'action' ? ActionType : T extends 'condtion' ? ConditionType : - T extends 'sequence' ? ConditionType | ActionType : never; diff --git a/webapp/src/types/automations/triggers.ts b/webapp/src/types/automations/triggers.ts index 47c9440..88ec3b0 100644 --- a/webapp/src/types/automations/triggers.ts +++ b/webapp/src/types/automations/triggers.ts @@ -1,7 +1,8 @@ import { AutomationTime } from "./common"; interface AutomationTriggerBase { - alias?: string; + alias?: string; + $smType: undefined; } export interface AutomationTriggerEvent extends AutomationTriggerBase {