templatized storymaking
This commit is contained in:
1 parent
02ec81c16a
commit
a9c3e9c890
9 files changed
+255
-172
No files matched your search
@@ -0,0 +1,34 @@
|
||||
import { HassEntities } from "home-assistant-js-websocket";
|
||||
import { FC } from "react";
|
||||
import { AutomationData } from "types/automations";
|
||||
import { consolidateAutomations } from "../helpers";
|
||||
import { useTagDB } from "../TagDB";
|
||||
import { useAutomationManagerState } from "./state";
|
||||
|
||||
export type AutomationManagerLoadedProps = {
|
||||
configAutomations: AutomationData[];
|
||||
hassEntities: HassEntities;
|
||||
onUpdateTags: (aid: string, tags: Record<string, string>) => void;
|
||||
};
|
||||
export const AutomationManagerLoaded: FC<AutomationManagerLoadedProps> = ({
|
||||
configAutomations,
|
||||
onUpdateTags,
|
||||
hassEntities,
|
||||
}) => {
|
||||
const state = useAutomationManagerState();
|
||||
const tagsDB = useTagDB(
|
||||
configAutomations.map(({ metadata: { id }, tags }) => ({
|
||||
id,
|
||||
tags,
|
||||
})),
|
||||
onUpdateTags
|
||||
);
|
||||
|
||||
const automations = consolidateAutomations(
|
||||
hassEntities,
|
||||
configAutomations.map(({ metadata }) => metadata),
|
||||
tagsDB
|
||||
);
|
||||
|
||||
return <></>;
|
||||
};
|
||||
Reference in new issue
Block a user