From 8bd243f5cd2af343ee7f0d5e01c32eeb42296e89 Mon Sep 17 00:00:00 2001 From: Jason Stieber Date: Fri, 16 Jun 2023 16:53:33 -0700 Subject: [PATCH 1/3] updated weathergov.js to relfect updated api response format changes --- modules/default/weather/providers/weathergov.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/weather/providers/weathergov.js b/modules/default/weather/providers/weathergov.js index 3c16bd7344..ea0412612a 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.precipitationLast3Hours.value; if (currentWeatherData.heatIndex.value !== null) { currentWeather.feelsLikeTemp = currentWeatherData.heatIndex.value; } else if (currentWeatherData.windChill.value !== null) { From 6277935864060300532465355563049df4367861 Mon Sep 17 00:00:00 2001 From: Jason Stieber Date: Fri, 16 Jun 2023 17:01:00 -0700 Subject: [PATCH 2/3] updated changelog.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 51ac3693a6..a165be0249 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,8 @@ Thanks to: @btoconnor, @bugsounet, @khassel, @kleinmantara and @WallysWellies. - [weather] Fixed type=daily for provider openmeteo showing nightly icons in forecast when current time is "nightly" (#3458) - [weather] Fixed forecast and hourly weather for provider openmeteo to use real temperatures, not apparent temperatures (#3466) - [tests] Fixed e2e tests running in docker container which needs `address: "0.0.0.0"` (#3479) +- Fix outdated API response formatting (#3124) + ## [2.27.0] - 2024-04-01 From e7de7e2798d81734045bf1534386fc78aec67ede Mon Sep 17 00:00:00 2001 From: Karsten Hassel Date: Thu, 27 Jun 2024 23:11:50 +0200 Subject: [PATCH 3/3] use precipitationLast3Hours as fallback --- CHANGELOG.md | 3 +-- modules/default/weather/providers/weathergov.js | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a165be0249..fe997efda7 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 @@ -37,8 +38,6 @@ Thanks to: @btoconnor, @bugsounet, @khassel, @kleinmantara and @WallysWellies. - [weather] Fixed type=daily for provider openmeteo showing nightly icons in forecast when current time is "nightly" (#3458) - [weather] Fixed forecast and hourly weather for provider openmeteo to use real temperatures, not apparent temperatures (#3466) - [tests] Fixed e2e tests running in docker container which needs `address: "0.0.0.0"` (#3479) -- Fix outdated API response formatting (#3124) - ## [2.27.0] - 2024-04-01 diff --git a/modules/default/weather/providers/weathergov.js b/modules/default/weather/providers/weathergov.js index ea0412612a..8a65478465 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.precipitationLast3Hours.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) {