fix parsing of feels like for weathergov

This commit is contained in:
philna 2022-02-08 21:07:08 -06:00
parent 880e2160a3
commit d0838d53c2

View File

@ -156,8 +156,13 @@ WeatherProvider.register("weathergov", {
currentWeather.rain = null; currentWeather.rain = null;
currentWeather.snow = null; currentWeather.snow = null;
currentWeather.precipitation = this.convertLength(currentWeatherData.precipitationLastHour.value); currentWeather.precipitation = this.convertLength(currentWeatherData.precipitationLastHour.value);
currentWeather.feelsLikeTemp = this.convertTemp(currentWeatherData.heatIndex.value); if (currentWeatherData.heatIndex.value !== null) {
currentWeather.feelsLikeTemp = this.convertTemp(currentWeatherData.heatIndex.value);
} else if (currentWeatherData.windChill.value !== null) {
currentWeather.feelsLikeTemp = this.convertTemp(currentWeatherData.windChill.value);
} else {
currentWeather.feelsLikeTemp = this.convertTemp(currentWeatherData.temperature.value);
}
// determine the sunrise/sunset times - not supplied in weather.gov data // determine the sunrise/sunset times - not supplied in weather.gov data
currentWeather.updateSunTime(this.config.lat, this.config.lon); currentWeather.updateSunTime(this.config.lat, this.config.lon);