fixed tsc

This commit is contained in:
ari committed 2022-05-30 15:20:42 -04:00
1 parent 7d111c853b
commit 8a90b56ac3
3 files changed
+11 -24

No files matched your search

@@ -7,42 +7,29 @@ import { OptionManager, updateActionData } from './OptionManager';
export const ActionDeviceState: OptionManager<DeviceAction> = {
defaultState: () => ({
alias: "",
type: "",
entity_id: "",
device_id: "",
domain: "",
}),
isReady: ({
alias,
type,
entity_id,
device_id,
domain,
}) => (
alias !== '' &&
type !== "" &&
entity_id !== "" &&
device_id !== "" &&
domain !== ""
),
isReady: () => true,
renderOptionList: (state, setState) => {
const update = updateActionData(state, setState);
return <>
<InputText
textBoxFor="device_id"
label="Device"
value={state.device_id}
value={state.device_id ?? ""}
onChange={device_id => update({ device_id })}
/>
<InputText
textBoxFor="type"
label="Action"
value={state.type}
value={state.type ?? ""}
onChange={type => update({ type })}
/>
<InputEntity
value={state.entity_id ?? ""}
onChange={entity_id => update({ entity_id, domain: entity_id.split('.')[0] })}
onChange={entity_id => update({
entity_id: entity_id ? entity_id : undefined,
domain: entity_id ? entity_id.split('.')[0] : ""
})}
/>
</>
}
+1 -1
View File
@@ -79,7 +79,7 @@ async function startHAConnection() {
} catch (error) {
haConnection = {
status: 'error',
error: translateErrorCodes(error),
error: translateErrorCodes(error as any),
}
throw error
}
+3 -3
View File
@@ -46,10 +46,10 @@ export const FireEventAction = st.intersection([
export const DeviceAction = st.intersection([
AutomationActionNodeBase,
st.type({
type: st.string(),
device_id: st.string(),
type: st.optional(st.string()),
device_id: st.optional(st.string()),
entity_id: st.optional(st.string()),
domain: st.string(),
domain: st.optional(st.string()),
})
]);