sync'd up

This commit is contained in:
ari committed 2022-08-18 10:50:11 -04:00
1 parent 7cb1a5d907
commit a391eae7c5
19 files changed
+320 -170

No files matched your search

+30 -33
View File
@@ -1,5 +1,4 @@
import { ApiService } from "apiService/core";
import { Page } from "components/Page";
import { FC } from "react";
import { useHA } from "haService";
import { AutomationManager } from "components/AutomationManager";
@@ -7,38 +6,36 @@ import { AutomationManager } from "components/AutomationManager";
export const AutomationRoute: FC<{ api: ApiService }> = ({ api }) => {
const ha = useHA();
return (
<Page>
<AutomationManager
api={api}
refreshAutomations={() => ha.callService("automation", "reload")}
triggerAutomation={(entity_id) =>
ha.callService(
"automation",
"trigger",
{},
{
entity_id,
}
)
}
forceDeleteAutomation={(eid) =>
ha.callHA({
<AutomationManager
api={api}
refreshAutomations={() => ha.callService("automation", "reload")}
triggerAutomation={(entity_id) =>
ha.callService(
"automation",
"trigger",
{},
{
entity_id,
}
)
}
forceDeleteAutomation={(eid) =>
ha.callHA({
entity_id: eid,
type: "config/entity_registry/remove",
})
}
onAutomationStateChange={(eid, on) =>
ha.callService(
"automation",
on ? "turn_on" : "turn_off",
{},
{
entity_id: eid,
type: "config/entity_registry/remove",
})
}
onAutomationStateChange={(eid, on) => {
ha.callService(
"automation",
on ? "turn_on" : "turn_off",
{},
{
entity_id: eid,
}
);
}}
haEntities={ha.entities}
/>
</Page>
}
)
}
haEntities={ha.entities}
/>
);
};