Skip to content

Weather plugin: add sunshine and wind km/h over time display#684

Open
CorentinWicht wants to merge 2 commits into
fatihak:mainfrom
CorentinWicht:feature/weather-improvements
Open

Weather plugin: add sunshine and wind km/h over time display#684
CorentinWicht wants to merge 2 commits into
fatihak:mainfrom
CorentinWicht:feature/weather-improvements

Conversation

@CorentinWicht
Copy link
Copy Markdown

This PR adds several improvements to the Weather plugin, primarily for Open-Meteo users.

Changes

  1. Sunshine duration overlay (Open-Meteo only)
    Added sunshine_duration to the hourly forecast API request. The chart now displays sunshine as yellow bars on the same y1 axis as precipitation probability (0–100%), giving users a quick visual indication of how sunny each hour will be. Controlled by a new Sunshine checkbox in the plugin settings.

  2. Temperature curve — removed area fill
    The yellow gradient fill under the temperature curve has been removed. The temperature is now shown as a clean orange line, reducing visual clutter and making the precipitation and sunshine overlays easier to read.

  3. Wind speed unit consistency (Open-Meteo)
    The Open-Meteo API is explicitly requested with wind_speed_unit=kmh (or mph for imperial) via the existing OPEN_METEO_UNIT_PARAMS. The wind value passed to the chart and the metrics panel now correctly reflects the unit already returned by the API, matching the UNITS dict label (km/h / mph).

  4. Wind speed unit fix (OpenWeatherMap hourly)
    OWM always returns wind speed in m/s regardless of the units parameter. The hourly parser now converts to km/h for metric/standard units, consistent with the current wind display in the metrics panel.

Screenshots
image

Tested with

  • Provider: Open-Meteo
  • Units: Metric
  • Device: Raspberry Pi Zero + Inky Impression

Copilot AI review requested due to automatic review settings May 7, 2026 08:32
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the Weather plugin’s hourly charting and unit handling, primarily improving Open‑Meteo visualizations (sunshine overlay, optional wind overlay) and aiming to standardize wind speed units.

Changes:

  • Extend Open‑Meteo hourly requests to include wind_speed_10m and sunshine_duration, and expose them to the hourly chart.
  • Add new settings toggles for Wind Speed and Sunshine overlays.
  • Adjust wind speed handling/labels and remove the temperature area fill to reduce chart clutter.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
src/plugins/weather/weather.py Updates units, Open‑Meteo query parameters, and hourly parsing to add wind/sunshine series.
src/plugins/weather/settings.html Adds new UI toggles for wind and sunshine overlays and loads/saves them.
src/plugins/weather/render/weather.html Adds wind annotation overlay, sunshine bar dataset, and removes temperature fill styling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/plugins/weather/weather.py
Comment thread src/plugins/weather/settings.html Outdated
Comment thread src/plugins/weather/render/weather.html Outdated
Comment thread src/plugins/weather/render/weather.html Outdated
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