Use entity icon in area card if there is only 1 entity

This commit is contained in:
Petar Petrov
2025-09-08 14:42:53 +03:00
parent 62714b2b68
commit a6e2befcb7

View File

@@ -273,12 +273,17 @@ class HuiAreaControlsCardFeature
.control=${control}
@click=${this._handleButtonTap}
>
<ha-domain-icon
.hass=${this.hass}
.domain=${domain}
.deviceClass=${deviceClass}
.state=${groupState}
></ha-domain-icon>
${entities.length === 1
? html`<ha-state-icon
.stateObj=${entities[0]}
.hass=${this.hass}
></ha-state-icon>`
: html` <ha-domain-icon
.hass=${this.hass}
.domain=${domain}
.deviceClass=${deviceClass}
.state=${groupState}
></ha-domain-icon>`}
</ha-control-button>
`;
})}