mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 10:16:46 +00:00
Show moon phase icon in state-label-badge (#7194)
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
parent
3bf6205ff7
commit
426a7ac8dd
@ -110,7 +110,9 @@ export class HaStateLabelBadge extends LitElement {
|
||||
return null;
|
||||
case "sensor":
|
||||
default:
|
||||
return state.state === UNKNOWN
|
||||
return state.attributes.device_class === "moon__phase"
|
||||
? null
|
||||
: state.state === UNKNOWN
|
||||
? "-"
|
||||
: state.attributes.unit_of_measurement
|
||||
? state.state
|
||||
@ -162,7 +164,9 @@ export class HaStateLabelBadge extends LitElement {
|
||||
? "hass:timer-outline"
|
||||
: "hass:timer-off-outline";
|
||||
default:
|
||||
return null;
|
||||
return state?.attributes.device_class === "moon__phase"
|
||||
? stateIcon(state)
|
||||
: null;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user