Thoroughly check for precipitationAmount values in weathergov provider (#3859)

Fixes #3856

---------

Co-authored-by: veeck <gitkraken@veeck.de>
This commit is contained in:
Veeck
2025-08-16 20:56:52 +02:00
committed by GitHub
parent 0ca7d23b69
commit 1b31cf19e9
2 changed files with 3 additions and 2 deletions

View File

@@ -29,8 +29,9 @@ Thanks to: @dathbe.
### Fixed
- [calendar] Fixed broken unittest that only broke at 1st of july and 1st of january (#3830)
- [calendar] Fixed broken unittest that only broke on the 1st of July and 1st of january (#3830)
- [clock] Fixed missing icons when no other modules with icons is loaded (#3834)
- [weather] Fixed handling of empty values in weathergov providers handling of precipitationAmount (#3859)
## [2.32.0] - 2025-07-01

View File

@@ -218,7 +218,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 ? currentWeatherData.precipitationLastHour.value : currentWeatherData.precipitationLast3Hours.value;
currentWeather.precipitationAmount = currentWeatherData.precipitationLastHour?.value ?? currentWeatherData.precipitationLast3Hours?.value;
if (currentWeatherData.heatIndex.value !== null) {
currentWeather.feelsLikeTemp = currentWeatherData.heatIndex.value;
} else if (currentWeatherData.windChill.value !== null) {