mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 11:16:35 +00:00
fix evaluating to false and remove ; (#4228)
This commit is contained in:
parent
b82b4a639e
commit
09e7638c89
@ -87,7 +87,7 @@ class MoreInfoWeather extends LitElement {
|
|||||||
${this.stateObj.attributes.temperature} ${this.getUnit("temperature")}
|
${this.stateObj.attributes.temperature} ${this.getUnit("temperature")}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
${this.stateObj.attributes.pressure
|
${this._showValue(this.stateObj.attributes.pressure)
|
||||||
? html`
|
? html`
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<iron-icon icon="hass:gauge"></iron-icon>
|
<iron-icon icon="hass:gauge"></iron-icon>
|
||||||
@ -101,7 +101,7 @@ class MoreInfoWeather extends LitElement {
|
|||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
: ""}
|
: ""}
|
||||||
${this.stateObj.attributes.humidity
|
${this._showValue(this.stateObj.attributes.humidity)
|
||||||
? html`
|
? html`
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<iron-icon icon="hass:water-percent"></iron-icon>
|
<iron-icon icon="hass:water-percent"></iron-icon>
|
||||||
@ -112,7 +112,7 @@ class MoreInfoWeather extends LitElement {
|
|||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
: ""}
|
: ""}
|
||||||
${this.stateObj.attributes.wind_speed
|
${this._showValue(this.stateObj.attributes.wind_speed)
|
||||||
? html`
|
? html`
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<iron-icon icon="hass:weather-windy"></iron-icon>
|
<iron-icon icon="hass:weather-windy"></iron-icon>
|
||||||
@ -128,7 +128,7 @@ class MoreInfoWeather extends LitElement {
|
|||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
: ""}
|
: ""}
|
||||||
${this.stateObj.attributes.visibility
|
${this._showValue(this.stateObj.attributes.visibility)
|
||||||
? html`
|
? html`
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<iron-icon icon="hass:eye"></iron-icon>
|
<iron-icon icon="hass:eye"></iron-icon>
|
||||||
@ -156,14 +156,14 @@ class MoreInfoWeather extends LitElement {
|
|||||||
></iron-icon>
|
></iron-icon>
|
||||||
`
|
`
|
||||||
: ""}
|
: ""}
|
||||||
${!item.templow
|
${!this._showValue(item.templow)
|
||||||
? html`
|
? html`
|
||||||
<div class="main">
|
<div class="main">
|
||||||
${this.computeDateTime(item.datetime)}
|
${this.computeDateTime(item.datetime)}
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
: ""}
|
: ""}
|
||||||
${item.templow
|
${this._showValue(item.templow)
|
||||||
? html`
|
? html`
|
||||||
<div class="main">
|
<div class="main">
|
||||||
${this.computeDate(item.datetime)}
|
${this.computeDate(item.datetime)}
|
||||||
@ -172,7 +172,7 @@ class MoreInfoWeather extends LitElement {
|
|||||||
${item.templow} ${this.getUnit("temperature")}
|
${item.templow} ${this.getUnit("temperature")}
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
: ""};
|
: ""}
|
||||||
<div class="temp">
|
<div class="temp">
|
||||||
${item.temperature} ${this.getUnit("temperature")}
|
${item.temperature} ${this.getUnit("temperature")}
|
||||||
</div>
|
</div>
|
||||||
@ -279,6 +279,10 @@ class MoreInfoWeather extends LitElement {
|
|||||||
}
|
}
|
||||||
return `${speed} ${this.getUnit("length")}/h`;
|
return `${speed} ${this.getUnit("length")}/h`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private _showValue(item: string): boolean {
|
||||||
|
return typeof item !== "undefined" && item !== null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user