Show alarm's friendly_name if set (#3565)

Closes https://github.com/home-assistant/home-assistant-polymer/issues/3459
This commit is contained in:
Ian Richardson 2019-09-01 23:51:01 -05:00 committed by Paulus Schoutsen
parent 6259e45128
commit c3e29e359a

View File

@ -114,7 +114,11 @@ class HuiAlarmPanelCard extends LitElement implements LovelaceCard {
}
return html`
<ha-card .header="${this._config.name || this._label(stateObj.state)}">
<ha-card
.header="${this._config.name ||
stateObj.attributes.friendly_name ||
this._label(stateObj.state)}"
>
<ha-label-badge
class="${classMap({ [stateObj.state]: true })}"
.icon="${ICONS[stateObj.state] || "hass:shield-outline"}"