Add alias support to all triggers (#13442)

This commit is contained in:
Franck Nijhof 2022-08-22 23:08:32 +02:00 committed by GitHub
parent 738367a7c7
commit 44422086d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 1 deletions

View File

@ -62,6 +62,7 @@ export interface ContextConstraint {
} }
export interface BaseTrigger { export interface BaseTrigger {
alias?: string;
platform: string; platform: string;
id?: string; id?: string;
variables?: Record<string, unknown>; variables?: Record<string, unknown>;

View File

@ -110,7 +110,7 @@ export default class HaAutomationTriggerRow extends LitElement {
<ha-expansion-panel <ha-expansion-panel
leftChevron leftChevron
.header=${describeTrigger(this.trigger)} .header=${this.trigger.alias || describeTrigger(this.trigger)}
> >
<ha-button-menu <ha-button-menu
slot="icons" slot="icons"

View File

@ -25,6 +25,7 @@ import type { SchemaUnion } from "../../../../../components/ha-form/types";
const stateTriggerStruct = assign( const stateTriggerStruct = assign(
baseTriggerStruct, baseTriggerStruct,
object({ object({
alias: optional(string()),
platform: literal("state"), platform: literal("state"),
entity_id: optional(union([string(), array(string())])), entity_id: optional(union([string(), array(string())])),
attribute: optional(string()), attribute: optional(string()),