Merge pull request #2810 from philnagel/weatherModule-weathergov-feelsLikeFix

fix parsing of feels like for weathergov
This commit is contained in:
Michael Teeuw 2022-03-11 15:39:11 +01:00 committed by GitHub
commit 5def02ff7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -156,8 +156,13 @@ WeatherProvider.register("weathergov", {
currentWeather.rain = null;
currentWeather.snow = null;
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
currentWeather.updateSunTime(this.config.lat, this.config.lon);