From dbc76eb6f66a5df82823c5b09e8c71f838430c1a Mon Sep 17 00:00:00 2001 From: Axel Duviella <60935256+Axellum@users.noreply.github.com> Date: Sun, 8 Nov 2020 14:45:27 +0100 Subject: [PATCH] Ne pas afficher la direction du vent si 'undefined'. (#45) --- dist/meteofrance-weather-card.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dist/meteofrance-weather-card.js b/dist/meteofrance-weather-card.js index fa61ba32..f85573f1 100644 --- a/dist/meteofrance-weather-card.js +++ b/dist/meteofrance-weather-card.js @@ -245,8 +245,7 @@ class MeteofranceWeatherCard extends LitElement { ${this.renderMeteoFranceDetail(this.hass.states[this._config.cloudCoverEntity])} - ${this.renderDetail(windDirections[parseInt((stateObj.attributes.wind_bearing + 11.25) / 22.5)] + " " + stateObj.attributes.wind_speed, "Vent", "mdi:weather-windy", - this.getUnit("speed"))} + ${this.renderDetail((stateObj.attributes.wind_bearing == undefined ? " " : windDirections[parseInt((stateObj.attributes.wind_bearing + 11.25) / 22.5)] + " ") + stateObj.attributes.wind_speed, "Vent", "mdi:weather-windy", this.getUnit("speed"))} ${this.renderMeteoFranceDetail(this.hass.states[this._config.rainChanceEntity])}