Skip to content

Open Meteo Widget - wind speed in m/s #876

@marcinbjorn

Description

@marcinbjorn

What is the request?

An option to set the wind speed unit to m/s.

Why is it useful?

Personal preference: Iceland commonly uses m/s for wind speed in weather forecasts, it's also the standard scientific and meteorological unit.

How could it be implemented?

Open-Meteo accepts wind_speed_unit=ms as an API call argument
All available units: kmh, ms, mph, kn

A new option for the widget could be added to config.yaml

open_meteo:
  options:
   # Units: ms, mph, kmh, kn
    wind_speed_unit: ms

In src.core.widgets.services.open_meteo file api.py, the wind speed unit could then be selected from a user-defined configuration value. If no user-defined value is provided, the existing logic could remain as the fallback:

# Line 63: wind_unit = "mph" if units == "imperial" else "kmh"
if user_wind_unit is not None:
    wind_unit = user_wind_unit
else:
    wind_unit = "mph" if units == "imperial" else "kmh"

Similar changes in files: widgets.py lines 445 and open_meteo.py line 808

This is not a full implementation, only an overview. I hardcoded m/s as wind unit, and it works for me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestRequest for new functionality or an enhancement.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions