Oro / pynanoleaf

A Python3 wrapper for the Nanoleaf API
MIT License
2 stars 5 forks source link

Asynchronous I/O #7

Closed milanmeu closed 3 years ago

milanmeu commented 3 years ago

Hi @Oro,

I would like to add asyncio support to pynanoleaf. Unfortunately, property setters are not very suitable for this and property getters are not allowed to make requests. This would entail a lot of breaking changes. I think it would be better to continue this as a fork because the API for the sync and async library will be completely different and have different dependencies.

Should I leave this a sync library and create an async fork or add asyncio to this library?

Oro commented 3 years ago

Thanks for asking @milanmeu ! I am absolutely fine with breaking changes if home assistant is also updated for those changes (as homeassistant was the reason I made this repo in the first place).

I am also more than fine with a fork and homeassistant then using your fork (or a completely new library), so please do feel free to go ahead with whatever you think it's best!

Just one caveat//probably good to know for you: I have never used asyncio or any async library in Python, so if you decide to push a PR please do plan in some time for me to review it (and please also link the homeassistant PR if you do)

keis commented 3 years ago

Feel free to ping me in if you want help reviewing the asyncio code :)

milanmeu commented 3 years ago

I have created a completely new library: https://github.com/milanmeu/aionanoleaf. Please open an issue (or PR) if you have any remarks.

I'm also working on push updates and touch events.

Thanks @Oro and @keis!