mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-10-30 22:01:57 +01:00
enhance_wx_model
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>
This commit is contained in:
1 parent
b9a2f56e39
commit
fe5db94647
3 files changed
+12
-1
No files matched your search
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
+5
-1
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user