Nullish coalescing entity card (#6484)

Fixes #6483
This commit is contained in:
Bram Kragten 2020-07-29 15:40:28 +02:00 committed by GitHub
parent 29bdf7877c
commit 83876fb9da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -124,7 +124,7 @@ export class HuiEntityCard extends LitElement implements LovelaceCard {
<div class="info">
<span class="value"
>${"attribute" in this._config
? stateObj.attributes[this._config.attribute!] ||
? stateObj.attributes[this._config.attribute!] ??
this.hass.localize("state.default.unknown")
: stateObj.attributes.unit_of_measurement
? stateObj.state