Improve error handling in automation i18n (#25266)

This commit is contained in:
Bram Kragten
2025-05-01 20:06:42 +03:00
committed by GitHub
parent dddba58d38
commit f608783551
2 changed files with 103 additions and 80 deletions

View File

@@ -73,16 +73,20 @@ class HaEntityAttributePicker extends LitElement {
return nothing;
}
const stateObj = this.hass.states[this.entityId!] as HassEntity | undefined;
return html`
<ha-combo-box
.hass=${this.hass}
.value=${this.value
? computeAttributeNameDisplay(
this.hass.localize,
this.hass.states[this.entityId!],
this.hass.entities,
this.value
)
? stateObj
? computeAttributeNameDisplay(
this.hass.localize,
stateObj,
this.hass.entities,
this.value
)
: this.value
: ""}
.autofocus=${this.autofocus}
.label=${this.label ??