From c89c3edf974d8de892ab8d93fa248961d27f6a09 Mon Sep 17 00:00:00 2001 From: Jason Stieber Date: Fri, 28 Jun 2024 13:21:38 -0700 Subject: [PATCH] Fix weathergov api precipitationLastHour (#3125) Pull request fixes small big in weathergov api format mismatch #3124 --------- Co-authored-by: Karsten Hassel --- CHANGELOG.md | 1 + modules/default/weather/providers/weathergov.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 51ac3693..fe997efd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ Thanks to: @btoconnor, @bugsounet, @khassel, @kleinmantara and @WallysWellies. - [calendar] Added config option "showEndsOnlyWithDuration" for default calendar - [compliments] Added `specialDayUnique` config option, defaults to `false` (#3465) +- [weather] Provider weathergov: Use `precipitationLast3Hours` if `precipitationLastHour` is `null` (#3124) ### Removed diff --git a/modules/default/weather/providers/weathergov.js b/modules/default/weather/providers/weathergov.js index 3c16bd73..8a654784 100644 --- a/modules/default/weather/providers/weathergov.js +++ b/modules/default/weather/providers/weathergov.js @@ -211,7 +211,7 @@ WeatherProvider.register("weathergov", { currentWeather.minTemperature = currentWeatherData.minTemperatureLast24Hours.value; currentWeather.maxTemperature = currentWeatherData.maxTemperatureLast24Hours.value; currentWeather.humidity = Math.round(currentWeatherData.relativeHumidity.value); - currentWeather.precipitationAmount = currentWeatherData.precipitationLastHour.value; + currentWeather.precipitationAmount = currentWeatherData.precipitationLastHour.value ? currentWeatherData.precipitationLastHour.value : currentWeatherData.precipitationLast3Hours.value; if (currentWeatherData.heatIndex.value !== null) { currentWeather.feelsLikeTemp = currentWeatherData.heatIndex.value; } else if (currentWeatherData.windChill.value !== null) {