added more trigger managers
This commit is contained in:
1 parent
7296a2c518
commit
d77f079a23
5 files changed
+122
-12
No files matched your search
@@ -0,0 +1,29 @@
|
||||
import { OptionManager } from './OptionManager';
|
||||
import { AutomationTriggerHA } from 'types/automations/triggers';
|
||||
import InputList from "components/Inputs/InputList";
|
||||
|
||||
|
||||
export const TriggerHAState: OptionManager<AutomationTriggerHA> = {
|
||||
defaultState: () => ({
|
||||
$smType: 'trigger',
|
||||
"alias": "HA Starts",
|
||||
"platform": "homeassistant",
|
||||
"event": "start",
|
||||
}),
|
||||
isReady: ({ alias }) => {
|
||||
return (alias !== '')
|
||||
},
|
||||
renderOptionList: (state, setState) => {
|
||||
return <>
|
||||
<InputList
|
||||
label="Event Type"
|
||||
current={state.event}
|
||||
options={['start', 'shutdown']}
|
||||
onChange={event => setState({
|
||||
...state, event,
|
||||
alias: event === 'shutdown' ? "HA Shutdown" : "HA Starts"
|
||||
})}
|
||||
/>
|
||||
</>
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user