Check for null target_temp (#4842)

Fixes #4359
This commit is contained in:
Bram Kragten 2020-02-12 13:48:27 +01:00 committed by GitHub
parent 4cdc4765f7
commit c5aa000a97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -100,7 +100,8 @@ class MoreInfoClimate extends LitElement {
</div>
`
: ""}
${stateObj.attributes.temperature !== undefined
${stateObj.attributes.temperature !== undefined &&
stateObj.attributes.temperature !== null
? html`
<ha-climate-control
.value=${stateObj.attributes.temperature}
@ -112,8 +113,10 @@ class MoreInfoClimate extends LitElement {
></ha-climate-control>
`
: ""}
${stateObj.attributes.target_temp_low !== undefined ||
stateObj.attributes.target_temp_high !== undefined
${(stateObj.attributes.target_temp_low !== undefined &&
stateObj.attributes.target_temp_low !== null) ||
(stateObj.attributes.target_temp_high !== undefined &&
stateObj.attributes.target_temp_high !== null)
? html`
<ha-climate-control
.value=${stateObj.attributes.target_temp_low}