Skip to content

Commit

Permalink
Update bom-weather-card.js
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidFW1960 committed Jul 11, 2019
1 parent 26d8c67 commit b33c57c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions bom-weather-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class BOMWeatherCard extends LitElement {
<br><span class="lowTemp" id="fcast-low-${daily.dayIndex}">${Math.round(this._hass.states[daily.templow].state)}${this.getUOM("temperature")}</span>` :
html`<br><span class="lowTemp" id="fcast-low-${daily.dayIndex}">${Math.round(this._hass.states[daily.templow].state)}</span> / <span class="highTemp" id="fcast-high-${daily.dayIndex}">${Math.round(this._hass.states[daily.temphigh].state)}${this.getUOM("temperature")}</span>`}
${this.config.entity_pop_1 && this.config.entity_pop_2 && this.config.entity_pop_3 && this.config.entity_pop_4 && this.config.entity_pop_5 ? html`<br><span class="pop" id="fcast-pop-${daily.dayIndex}">${Math.round(this._hass.states[daily.pop].state)} %</span>` : ``}
${this.config.entity_pos_1 && this.config.entity_pos_2 && this.config.entity_pos_3 && this.config.entity_pos_4 && this.config.entity_pos_5 ? html`<br><span class="pos" id="fcast-pos-${daily.dayIndex}">${this._hass.states[daily.pos].state} mm</span>` : ``}
${this.config.entity_pos_1 && this.config.entity_pos_2 && this.config.entity_pos_3 && this.config.entity_pos_4 && this.config.entity_pos_5 ? html`<br><span class="pos" id="fcast-pos-${daily.dayIndex}">${this._hass.states[daily.pos].state} ${this.getUOM("precipitation")}</span>` : ``}
<div class="fcasttooltiptext" id="fcast-summary-${daily.dayIndex}">${ this.config.tooltips ? this._hass.states[daily.summary].state : ""}</div>
</div>`)}
</div>
Expand Down Expand Up @@ -422,7 +422,7 @@ get beaufortWind() {
if (this._hass.states[this.config.entity_wind_speed].state >= 18) return 5;
if (this._hass.states[this.config.entity_wind_speed].state >= 13) return 4;
if (this._hass.states[this.config.entity_wind_speed].state >= 8) return 3;
if (this._hass.states[this.config.entity_wind_speed].state >=3) return 2;
if (this._hass.states[this.config.entity_wind_speed].state >= 3) return 2;
if (this._hass.states[this.config.entity_wind_speed].state >= 1) return 1;
default: // Assume m/s
if ((this._hass.states[this.config.entity_wind_speed].state * 3.6) >= 118) return 12;
Expand Down Expand Up @@ -557,6 +557,11 @@ style() {
color: var(--primary-text-color);
}
.pos {
font-weight: 400;
color: var(--primary-text-color);
}
.variations {
display: flex;
flex-flow: row wrap;
Expand Down Expand Up @@ -757,7 +762,7 @@ style() {
root.getElementById("fcast-high-" + daily.dayIndex).textContent = `${Math.round(this._hass.states[daily.temphigh].state)}${this.getUOM("temperature")}`;
root.getElementById("fcast-low-" + daily.dayIndex).textContent = `${Math.round(this._hass.states[daily.templow].state)}${this.config.old_daily_format ? this.getUOM("temperature") : ""}`;
if (this.config.entity_pop_1 && this.config.entity_pop_2 && this.config.entity_pop_3 && this.config.entity_pop_4 && this.config.entity_pop_5) { root.getElementById("fcast-pop-" + daily.dayIndex).textContent = `${Math.round(this._hass.states[daily.pop].state)} %` }
if (this.config.entity_pos_1 && this.config.entity_pos_2 && this.config.entity_pos_3 && this.config.entity_pos_4 && this.config.entity_pos_5) { root.getElementById("fcast-pos-" + daily.dayIndex).textContent = `${this._hass.states[daily.pos].state} mm` }
if (this.config.entity_pos_1 && this.config.entity_pos_2 && this.config.entity_pos_3 && this.config.entity_pos_4 && this.config.entity_pos_5) { root.getElementById("fcast-pos-" + daily.dayIndex).textContent = `${this._hass.states[daily.pos].state} ${this.getUOM("precipitation")}` }
root.getElementById("fcast-summary-" + daily.dayIndex).textContent = `${this._hass.states[daily.summary].state}`;
});

Expand Down

0 comments on commit b33c57c

Please sign in to comment.