Skip to content

Add UV index information throughout the app#10

Merged
andreisugu merged 2 commits intomainfrom
copilot/add-uv-level-information
Mar 5, 2026
Merged

Add UV index information throughout the app#10
andreisugu merged 2 commits intomainfrom
copilot/add-uv-level-information

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 5, 2026

UV index data was absent from the app despite being readily available from the existing open-meteo weather API. This PR surfaces UV levels wherever contextually appropriate: current conditions, hourly forecasts, charts, AI recommendations, alert tips, and push notifications.

API

  • All weather API calls now request uv_index in current/hourly and uv_index_max in daily parameters

UI (index.html, home.html, home.js)

  • Current weather widget: new #current-uv element shows live UV index (or daily max for non-today days)
  • Hourly table: new UV Index column with color-coded level badges
  • Weather chart: new ☀️ UV Index checkbox adds an optional line dataset on a dedicated y2 right axis
  • getUVLevel(uvIndex) helper renders color-coded badges: Low (0–2) → Moderate (3–5) → High (6–7) → Very High (8–10) → Extreme (11+)

Recommendations & alerts (views.py, static-sentiment.js)

  • make_recommendation() / makeRecommendation() append UV-specific advice when UV ≥ 6
  • get_alert_level() / getAlertLevel() accept weather_data and conditionally append a UV Protection tip to every alert level's tips list
  • Static form handler now fetches weather (with UV) in parallel with pollen data via Promise.all

Notifications (send_notifications.py)

  • New get_uv_forecast() fetches today's uv_index_max; create_notification_message() includes UV level label and tailored advice in the message body

Translations (translations.js)

  • Added EN + RO entries for UV Index, Moderate, Very High, Extreme, UV Protection

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: andreisugu <35407471+andreisugu@users.noreply.github.com>
Copilot AI changed the title [WIP] Add information about UV levels where reasonable Add UV index information throughout the app Mar 5, 2026
@andreisugu andreisugu marked this pull request as ready for review March 5, 2026 11:08
@andreisugu andreisugu merged commit a9be0e9 into main Mar 5, 2026
0 of 3 checks passed
@andreisugu andreisugu deleted the copilot/add-uv-level-information branch March 5, 2026 11:11
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