initial graph view
This commit is contained in:
1 parent
12d086a5c0
commit
6d4fe7749a
8 files changed
+131
-48
No files matched your search
@@ -1,22 +1,26 @@
|
||||
import { AutomationTime } from "./common";
|
||||
|
||||
export interface AutomationTriggerEvent {
|
||||
interface AutomationTriggerBase {
|
||||
alias?: string;
|
||||
}
|
||||
|
||||
export interface AutomationTriggerEvent extends AutomationTriggerBase {
|
||||
platform: 'event';
|
||||
event_type: string | string[];
|
||||
event_data?: any;
|
||||
context?: any;
|
||||
}
|
||||
export interface AutomationTriggerHA {
|
||||
export interface AutomationTriggerHA extends AutomationTriggerBase {
|
||||
platform: 'homeassistant';
|
||||
event: 'start' | 'shutdown';
|
||||
}
|
||||
export interface AutomationTriggerMQTT {
|
||||
export interface AutomationTriggerMQTT extends AutomationTriggerBase {
|
||||
platform: 'mqtt';
|
||||
topic: string;
|
||||
payload: string;
|
||||
value_template: string;
|
||||
}
|
||||
export interface AutomationTriggerNumericState {
|
||||
export interface AutomationTriggerNumericState extends AutomationTriggerBase {
|
||||
platform: 'numeric_state';
|
||||
entity_id: string | string[];
|
||||
attribute?: string;
|
||||
@@ -25,7 +29,7 @@ export interface AutomationTriggerNumericState {
|
||||
below?: string;
|
||||
for?: AutomationTime;
|
||||
}
|
||||
export interface AutomationTriggerState {
|
||||
export interface AutomationTriggerState extends AutomationTriggerBase {
|
||||
platform: 'state';
|
||||
entity_id: string | string[];
|
||||
attribute?: string;
|
||||
@@ -33,44 +37,44 @@ export interface AutomationTriggerState {
|
||||
to?: string | string[];
|
||||
for?: AutomationTime;
|
||||
}
|
||||
export interface AutomationTriggerTag {
|
||||
export interface AutomationTriggerTag extends AutomationTriggerBase {
|
||||
platform: 'tag';
|
||||
tag_id: string | string[];
|
||||
device_id: string | string[];
|
||||
}
|
||||
export interface AutomationTriggerTemplate {
|
||||
export interface AutomationTriggerTemplate extends AutomationTriggerBase {
|
||||
platform: 'template';
|
||||
value_template: string;
|
||||
for?: AutomationTime;
|
||||
}
|
||||
export interface AutomationTriggerTime {
|
||||
export interface AutomationTriggerTime extends AutomationTriggerBase {
|
||||
platform: 'time';
|
||||
at: string | string[];
|
||||
}
|
||||
export interface AutomationTriggerTimePattern {
|
||||
export interface AutomationTriggerTimePattern extends AutomationTriggerBase {
|
||||
platform: 'time_pattern';
|
||||
hours?: string;
|
||||
minutes?: string;
|
||||
seconds?: string;
|
||||
}
|
||||
export interface AutomationTriggerWebhook {
|
||||
export interface AutomationTriggerWebhook extends AutomationTriggerBase {
|
||||
platform: 'webhook';
|
||||
webhook_id: string;
|
||||
}
|
||||
export interface AutomationTriggerZone {
|
||||
export interface AutomationTriggerZone extends AutomationTriggerBase {
|
||||
platform: 'zone';
|
||||
entity_id: string;
|
||||
zone: string;
|
||||
event: 'enter' | 'leave';
|
||||
}
|
||||
export interface AutomationTriggerDevice {
|
||||
export interface AutomationTriggerDevice extends AutomationTriggerBase {
|
||||
platform: 'device';
|
||||
device_id: string;
|
||||
domain: string;
|
||||
type: string;
|
||||
subtype: string;
|
||||
}
|
||||
export type AutomationTriggerGeneric = {
|
||||
export interface AutomationTriggerGeneric extends AutomationTriggerBase {
|
||||
platform: string;
|
||||
}
|
||||
export type AutomationTrigger =
|
||||
|
||||
@@ -66,6 +66,11 @@ export const getDescriptionFromAutomationNode = <N extends AutomationNodeTypes>(
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (node.alias) {
|
||||
return node.alias;
|
||||
}
|
||||
return node.platform
|
||||
}
|
||||
return 'n/a'
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user