Skip to content

[plugins] Change weather API to OpenWeatherMap#192

Merged
johnmaguire merged 2 commits intojohnmaguire:masterfrom
obviyus:weather-api
Jun 12, 2021
Merged

[plugins] Change weather API to OpenWeatherMap#192
johnmaguire merged 2 commits intojohnmaguire:masterfrom
obviyus:weather-api

Conversation

@obviyus
Copy link
Copy Markdown
Contributor

@obviyus obviyus commented Jun 11, 2021

Fixes #191.

  • Now uses the OpenWeatherMap API (docs) for weather data
  • By default, the API endpoint requires different parameters depending on whether the location is a city name, city id, geographical coordinates or a zip code. It might make sense to use something like geopy to get a standard lat/lon format for all locations.

Copy link
Copy Markdown

@lailoken503 lailoken503 left a comment

Choose a reason for hiding this comment

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

Made a backup of the original plugin, and copied the update into a new plugin.py, looks like it works great, bonus that the .setw didn't need to be used again. Thanks!

@johnmaguire johnmaguire merged commit 7b39237 into johnmaguire:master Jun 12, 2021
@johnmaguire
Copy link
Copy Markdown
Owner

Thanks for this! There was a hiccup in that OpenWeatherMap doesn't seem to return the same location for many old queries - especially around zip codes.

I ended up implementing WeatherAPI.com as well. There's a toggle now, so either provider can be selected via configuration.

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.

Switch from retired Yahoo Weather API to OpenWeatherMap (or another free API)

3 participants