Fix entity card state display (#5631)

This commit is contained in:
Bram Kragten 2020-04-27 08:48:02 +02:00 committed by GitHub
parent 7c6ba1a782
commit a47c3fa854
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -129,6 +129,8 @@ export class HuiEntityCard extends LitElement implements LovelaceCard {
>${"attribute" in this._config
? stateObj.attributes[this._config.attribute!] ||
this.hass.localize("state.default.unknown")
: stateObj.attributes.unit_of_measurement
? stateObj.state
: computeStateDisplay(
this.hass.localize,
stateObj,