mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-09 19:09:48 +00:00
Convert automation actions/scripts to Lit (#4324)
* Convert automation actions/scripts to Lit * Update ha-automation-action-row.ts * Comments
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { HomeAssistant } from "../types";
|
||||
import { computeObjectId } from "../common/entity/compute_object_id";
|
||||
import { Condition } from "./automation";
|
||||
|
||||
export interface EventAction {
|
||||
event: string;
|
||||
@@ -7,12 +8,40 @@ export interface EventAction {
|
||||
event_data_template?: { [key: string]: any };
|
||||
}
|
||||
|
||||
export interface ServiceAction {
|
||||
service: string;
|
||||
entity_id?: string;
|
||||
data?: { [key: string]: any };
|
||||
}
|
||||
|
||||
export interface DeviceAction {
|
||||
device_id: string;
|
||||
domain: string;
|
||||
entity_id: string;
|
||||
}
|
||||
|
||||
export interface DelayAction {
|
||||
delay: number;
|
||||
}
|
||||
|
||||
export interface SceneAction {
|
||||
scene: string;
|
||||
}
|
||||
|
||||
export interface WaitAction {
|
||||
wait_template: string;
|
||||
timeout?: number;
|
||||
}
|
||||
|
||||
export type Action =
|
||||
| EventAction
|
||||
| DeviceAction
|
||||
| ServiceAction
|
||||
| Condition
|
||||
| DelayAction
|
||||
| SceneAction
|
||||
| WaitAction;
|
||||
|
||||
export const triggerScript = (
|
||||
hass: HomeAssistant,
|
||||
entityId: string,
|
||||
|
||||
Reference in New Issue
Block a user