Skip to content

weather: fix UV index display and add WeatherFlow precipitation#4108

Merged
rejas merged 3 commits intoMagicMirrorOrg:developfrom
KristjanESPERANTO:weather
Apr 19, 2026
Merged

weather: fix UV index display and add WeatherFlow precipitation#4108
rejas merged 3 commits intoMagicMirrorOrg:developfrom
KristjanESPERANTO:weather

Conversation

@KristjanESPERANTO
Copy link
Copy Markdown
Collaborator

While looking at the WeatherFlow provider (to evaluate #4107), I noticed a few things that weren't quite right.

  1. UV index was broken for most providers in forecast/hourly views. The templates read uv_index, but only the WeatherAPI provider actually wrote that key. All other providers (OpenWeatherMap, WeatherFlow, PirateWeather, etc.) use uvIndex - so UV was silently never displayed for them. This went unnoticed because showUVIndex defaults to false and there were no test assertions for it. Standardized everything on uvIndex and added test coverage.

  2. WeatherFlow didn't map precipitation for current weather. The API provides precip_accum_local_day and precip_probability, but they weren't passed through. While adding them I also noticed the template used truthiness checks, which hid valid zero values. Fixed both.

  3. || vs ?? in WeatherFlow provider. Several numeric fields used || null, replacing valid 0 with null. Switched to ?? for correctness.

Replace || with ?? for numeric weather fields so valid zero values
are preserved instead of being replaced with null.
Add precip_accum_local_day and precip_probability to current conditions.
Use null-safe checks in template so zero values render correctly.
Rename uv_index to uvIndex in weatherapi provider to match the
canonical field name used by all other providers. Update all three
templates (current, forecast, hourly) to read uvIndex.
@rejas rejas merged commit de3f57f into MagicMirrorOrg:develop Apr 19, 2026
12 checks passed
@KristjanESPERANTO KristjanESPERANTO deleted the weather branch April 19, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants