From 485e2fde25431bb55bc3ccd5f0dbe2c49688e256 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Thu, 13 Feb 2020 17:41:51 +0100 Subject: [PATCH] Update hui-thermostat-card.ts (#4863) --- src/panels/lovelace/cards/hui-thermostat-card.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/panels/lovelace/cards/hui-thermostat-card.ts b/src/panels/lovelace/cards/hui-thermostat-card.ts index 4fba096404..fa099fefdc 100644 --- a/src/panels/lovelace/cards/hui-thermostat-card.ts +++ b/src/panels/lovelace/cards/hui-thermostat-card.ts @@ -269,7 +269,11 @@ export class HuiThermostatCard extends LitElement implements LovelaceCard { applyThemesOnElement(this, this.hass.themes, this._config.theme); } - this._setTemp = this._getSetTemp(this.hass!.states[this._config!.entity]); + const stateObj = this.hass!.states[this._config!.entity]; + if (!stateObj) { + return; + } + this._setTemp = this._getSetTemp(stateObj); this.rescale_svg(); }