From fe5db94647380fd32666c49d49315b606ffd086c Mon Sep 17 00:00:00 2001 From: Kelly Date: Sat, 15 Aug 2026 19:14:49 -0700 Subject: [PATCH] enhance_wx_model MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit can now edit config.ini and add wx_model This allows Canadian users (and others) to get more accurate forecasts using their regional weather models instead of the global blended model. The change is fully backward-compatible — existing installations work unchanged. handles https://github.com/SpudGunMan/meshing-around/issues/331 Co-Authored-By: va3vbe <209848734+va3vbe@users.noreply.github.com> --- config.template | 6 ++++++ modules/settings.py | 1 + modules/wx_meteo.py | 6 +++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/config.template b/config.template index b8b402f..1978514 100644 --- a/config.template +++ b/config.template @@ -222,6 +222,12 @@ satList = 25544,7530 # use Open-Meteo API for weather data not NOAA useful for non US locations UseMeteoWxAPI = False +# Optional: specify an Open-Meteo model for more locally-accurate forecasts. +# Leave blank for Open-Meteo's automatic best_match selection. +# Examples: gem_seamless (Canada), icon_seamless (Europe), jma_seamless (Japan) +# Full list at https://open-meteo.com/en/docs (see "Weather models" dropdown) +meteoWxModel = + # NOAA weather forecast days NOAAforecastDuration = 3 # number of weather alerts to display diff --git a/modules/settings.py b/modules/settings.py index c3ee5fb..9cbe3de 100644 --- a/modules/settings.py +++ b/modules/settings.py @@ -317,6 +317,7 @@ try: fuzz_config_location = config['location'].getboolean('fuzzConfigLocation', True) # default True fuzzItAll = config['location'].getboolean('fuzzAllLocations', False) # default False, only fuzz config location use_meteo_wxApi = config['location'].getboolean('UseMeteoWxAPI', False) # default False use NOAA + meteo_wx_model = config['location'].get('meteoWxModel', '') # default empty string for best_match use_metric = config['location'].getboolean('useMetric', False) # default Imperial units repeater_lookup = config['location'].get('repeaterLookup', 'rbook') # default repeater lookup source n2yoAPIKey = config['location'].get('n2yoAPIKey', '') # default empty diff --git a/modules/wx_meteo.py b/modules/wx_meteo.py index ffeb416..36ae84f 100644 --- a/modules/wx_meteo.py +++ b/modules/wx_meteo.py @@ -4,7 +4,7 @@ import requests import json from modules.log import logger -from modules.settings import ERROR_FETCHING_DATA +from modules.settings import ERROR_FETCHING_DATA, meteo_wx_model def get_weather_data(api_url, params): response = requests.get(api_url, params=params) @@ -34,6 +34,10 @@ def get_wx_meteo(lat=0, lon=0, unit=0): params["distance_unit"] = "mile" params["pressure_unit"] = "inHg" + # Add optional weather model if configured + if meteo_wx_model: + params["models"] = meteo_wx_model + try: # Fetch the weather data weather_data = get_weather_data(url, params)