mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 19:26:36 +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;
|
return null;
|
||||||
case "sensor":
|
case "sensor":
|
||||||
default:
|
default:
|
||||||
return state.state === UNKNOWN
|
return state.attributes.device_class === "moon__phase"
|
||||||
|
? null
|
||||||
|
: state.state === UNKNOWN
|
||||||
? "-"
|
? "-"
|
||||||
: state.attributes.unit_of_measurement
|
: state.attributes.unit_of_measurement
|
||||||
? state.state
|
? state.state
|
||||||
@ -162,7 +164,9 @@ export class HaStateLabelBadge extends LitElement {
|
|||||||
? "hass:timer-outline"
|
? "hass:timer-outline"
|
||||||
: "hass:timer-off-outline";
|
: "hass:timer-off-outline";
|
||||||
default:
|
default:
|
||||||
return null;
|
return state?.attributes.device_class === "moon__phase"
|
||||||
|
? stateIcon(state)
|
||||||
|
: null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user