Skip to content

Commit 1b31cf1

Browse files
rejasveeck
andauthored
Thoroughly check for precipitationAmount values in weathergov provider (#3859)
Fixes #3856 --------- Co-authored-by: veeck <[email protected]>
1 parent 0ca7d23 commit 1b31cf1

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ Thanks to: @dathbe.
2929

3030
### Fixed
3131

32-
- [calendar] Fixed broken unittest that only broke at 1st of july and 1st of january (#3830)
32+
- [calendar] Fixed broken unittest that only broke on the 1st of July and 1st of january (#3830)
3333
- [clock] Fixed missing icons when no other modules with icons is loaded (#3834)
34+
- [weather] Fixed handling of empty values in weathergov providers handling of precipitationAmount (#3859)
3435

3536
## [2.32.0] - 2025-07-01
3637

modules/default/weather/providers/weathergov.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ WeatherProvider.register("weathergov", {
218218
currentWeather.minTemperature = currentWeatherData.minTemperatureLast24Hours.value;
219219
currentWeather.maxTemperature = currentWeatherData.maxTemperatureLast24Hours.value;
220220
currentWeather.humidity = Math.round(currentWeatherData.relativeHumidity.value);
221-
currentWeather.precipitationAmount = currentWeatherData.precipitationLastHour.value ? currentWeatherData.precipitationLastHour.value : currentWeatherData.precipitationLast3Hours.value;
221+
currentWeather.precipitationAmount = currentWeatherData.precipitationLastHour?.value ?? currentWeatherData.precipitationLast3Hours?.value;
222222
if (currentWeatherData.heatIndex.value !== null) {
223223
currentWeather.feelsLikeTemp = currentWeatherData.heatIndex.value;
224224
} else if (currentWeatherData.windChill.value !== null) {

0 commit comments

Comments
 (0)