Use alias instead of description in case set in actions/conditions (#13441)

This commit is contained in:
Franck Nijhof 2022-08-22 20:27:13 +02:00 committed by GitHub
parent 5fb2e3316a
commit 738367a7c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 2 deletions

View File

@ -145,7 +145,7 @@ export default class HaAutomationActionRow extends LitElement {
: ""} : ""}
<ha-expansion-panel <ha-expansion-panel
leftChevron leftChevron
.header=${describeAction(this.hass, this.action)} .header=${this.action.alias || describeAction(this.hass, this.action)}
> >
${this.index !== 0 ${this.index !== 0
? html` ? html`

View File

@ -10,6 +10,7 @@ import type { HomeAssistant } from "../../../../../types";
import { ActionElement } from "../ha-automation-action-row"; import { ActionElement } from "../ha-automation-action-row";
const actionStruct = object({ const actionStruct = object({
alias: optional(string()),
service: optional(string()), service: optional(string()),
entity_id: optional(entityIdOrAll()), entity_id: optional(entityIdOrAll()),
target: optional(any()), target: optional(any()),

View File

@ -80,7 +80,7 @@ export default class HaAutomationConditionRow extends LitElement {
<ha-expansion-panel <ha-expansion-panel
leftChevron leftChevron
.header=${describeCondition(this.condition)} .header=${this.condition.alias || describeCondition(this.condition)}
> >
<ha-progress-button slot="icons" @click=${this._testCondition}> <ha-progress-button slot="icons" @click=${this._testCondition}>
${this.hass.localize( ${this.hass.localize(

View File

@ -12,6 +12,7 @@ import { forDictStruct } from "../../structs";
import type { ConditionElement } from "../ha-automation-condition-row"; import type { ConditionElement } from "../ha-automation-condition-row";
const stateConditionStruct = object({ const stateConditionStruct = object({
alias: optional(string()),
condition: literal("state"), condition: literal("state"),
entity_id: optional(string()), entity_id: optional(string()),
attribute: optional(string()), attribute: optional(string()),