custom-components / sensor.owlintuition

A set of sensors to integrate the OWL Intuition devices network
MIT License
11 stars 9 forks source link

Remove coroutine decorator removed in Python 3.11 #31

Closed shortbloke closed 1 year ago

shortbloke commented 1 year ago

Fixed #30 coroutine decorator was deprecated in Python 3.8 and removed from Python 3.11, per: https://docs.python.org/3.10/library/asyncio-task.html#generator-based-coroutines

shortbloke commented 1 year ago

@glpatcern Turned out to be very simple.

glpatcern commented 1 year ago

Can't be so simple :-D

Jokes apart, shouldn't we replace that with an equivalent decorator for async initialization to properly work? What are other integrations doing?

shortbloke commented 1 year ago

Looking at other components, I don't see any additional changes being made. The code had already changed the functions to include the async prefix and there's no use of yield.

Now, that's not to say there aren't some improvements still to be made. The component takes ~100 seconds to start for me,