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:
Bram Kragten
2019-12-06 12:14:45 +01:00
committed by GitHub
parent 073428849e
commit 393adacc9e
31 changed files with 892 additions and 990 deletions

View File

@@ -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,