csparpa / pyowm

A Python wrapper around the OpenWeatherMap web API
https://pyowm.readthedocs.io
MIT License
789 stars 171 forks source link

Support One Call API #301

Closed difelice closed 4 years ago

difelice commented 4 years ago

Overview

In the dusk of the popular Dark Sky API, it might be worth considering to add support for the One Call API, which is considered the alternative.

Reference

Migration guide

https://openweathermap.org/darksky-openweather?gclid=Cj0KCQjw-Mr0BRDyARIsAKEFbefcb00d_wztgHKOYj4HYEF1fLl-DnE0Yek9vWQ_bxptj2PcYLSNhDwaAu8REALw_wcB

API docs

https://openweathermap.org/api/one-call-api

csparpa commented 4 years ago

Thanks for pointing this out @difelice I'm not sure I can keep up with coding that for the moment - would you help with it ?

difelice commented 4 years ago

Sure. I'll have a look at it. Thanks.

edenhaus commented 4 years ago

I can also help you. I'm also planning to add OneCall to Home Assistant after it is supported here.

I started to look about the schema of the daily part. The rest of the schema will follow the next days. The most attributes are the same as from the daily api call. So we can use the Weather Object and extend it. Below the differences of both:

New attributes:

@difelice Can I help you somehow?

difelice commented 4 years ago

Hi @edenhaus , sorry for the late response.

I haven't started coding, just exploring current code base to have a rough idea and which of current ones can be used a starting point.

Please feel free to work on it if interested.

Thanks.

edenhaus commented 4 years ago

I'm already at a good point and it works already partly. I think until end of next week it will be finished. Hopefully the tests don't take to much time :P

valepe commented 4 years ago

Is possible with the new api to have the daily min and max temperatures? Until now weather integration shows the max one only.

edenhaus commented 4 years ago

Is possible with the new api to have the daily min and max temperatures? Until now weather integration shows the max one only.

All data which is returned by the oneCall can be found in the under https://openweathermap.org/api/one-call-api

edenhaus commented 4 years ago

So the first version is done. I'm not quite happy with the tests, so if some one has an idea to test better, feel free to comment on the pull request or even better implement it directly :)

csparpa commented 4 years ago

@difelice @valepe and anyone else interested: @edenhaus has provided an implementation. I encourage you to test it out, it's on the develop branch