Update hui-thermostat-card.ts (#4863)

This commit is contained in:
Bram Kragten 2020-02-13 17:41:51 +01:00 committed by GitHub
parent 6feaf64c90
commit 485e2fde25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();
}