Skip to content

Commit

Permalink
openmeteo: API now handles URI-encoded commas properly
Browse files Browse the repository at this point in the history
We can go back to the original parameter style I wanted to use for daily
& hourly fields, and stop sending API requests with a bunch of redundant
field names due to how requests builds GET URIs from array params.
  • Loading branch information
dgw authored and RustyBower committed Nov 2, 2023
1 parent dbd75e1 commit eafae26
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions sopel_modules/weather/providers/weather/openmeteo.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,7 @@ def openmeteo_forecast(bot, latitude, longitude, location):
params = {
'latitude': latitude,
'longitude': longitude,
'daily': [
'temperature_2m_min',
'temperature_2m_max',
'weathercode',
],
'daily': 'temperature_2m_min,temperature_2m_max,weathercode',
'timeformat': 'unixtime',
'timezone': 'auto',
}
Expand Down Expand Up @@ -86,7 +82,7 @@ def openmeteo_weather(bot, latitude, longitude, location):
'current_weather': 1,
'windspeed_unit': 'ms',
'hourly': 'relativehumidity_2m',
'daily': ['sunrise', 'sunset'],
'daily': 'sunrise,sunset',
'timeformat': 'unixtime',
'timezone': 'auto',
}
Expand Down

0 comments on commit eafae26

Please sign in to comment.