mirror of
https://github.com/home-assistant/frontend.git
synced 2026-04-20 17:43:36 +00:00
18 lines
543 B
TypeScript
18 lines
543 B
TypeScript
import { HomeAssistant } from "../types";
|
|
import computeObjectId from "../common/entity/compute_object_id";
|
|
|
|
export interface EventAction {
|
|
event: string;
|
|
event_data?: { [key: string]: any };
|
|
event_data_template?: { [key: string]: any };
|
|
}
|
|
|
|
export const triggerScript = (
|
|
hass: HomeAssistant,
|
|
entityId: string,
|
|
variables?: {}
|
|
) => hass.callService("script", computeObjectId(entityId), variables);
|
|
|
|
export const deleteScript = (hass: HomeAssistant, objectId: string) =>
|
|
hass.callApi("DELETE", `config/script/config/${objectId}`);
|