Display zone name in state badge (#14974)

This commit is contained in:
Paul Bottein 2023-01-03 14:58:30 +01:00 committed by GitHub
parent f31a7c3af0
commit 9836912efa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -223,6 +223,10 @@ export class HaStateLabelBadge extends LitElement {
if (domainStateKey) {
return this.hass!.localize(`state_badge.${domainStateKey}`);
}
// Person and device tracker state can be zone name
if (domain === "person" || domain === "device_tracker") {
return entityState.state;
}
if (domain === "timer") {
return secondsToDuration(_timerTimeRemaining);
}