mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-22 16:56:35 +00:00
Prevent formatting for unknown attribute (#9252)
This commit is contained in:
parent
465a91dbf3
commit
f55e911313
@ -125,11 +125,12 @@ export class HuiEntityCard extends LitElement implements LovelaceCard {
|
||||
<div class="info">
|
||||
<span class="value"
|
||||
>${"attribute" in this._config
|
||||
? formatAttributeValue(
|
||||
this.hass,
|
||||
stateObj.attributes[this._config.attribute!] ??
|
||||
this.hass.localize("state.default.unknown")
|
||||
)
|
||||
? stateObj.attributes[this._config.attribute!] !== undefined
|
||||
? formatAttributeValue(
|
||||
this.hass,
|
||||
stateObj.attributes[this._config.attribute!]
|
||||
)
|
||||
: this.hass.localize("state.default.unknown")
|
||||
: stateObj.attributes.unit_of_measurement
|
||||
? formatNumber(stateObj.state, this.hass.locale)
|
||||
: computeStateDisplay(
|
||||
|
Loading…
x
Reference in New Issue
Block a user