joaorb64 / joycond-cemuhook

Support for cemuhook's UDP protocol for joycond devices
MIT License
139 stars 19 forks source link

Deprecation Warnings #60

Closed cipitaua closed 2 years ago

cipitaua commented 2 years ago

I have used joycond-cemuhook.py for several months but recently it prints a lot of warnings:

./joycond-cemuhook.py:161: DeprecationWarning: There is no current event loop
  tasks = {asyncio.ensure_future(self._handle_motion_events())}

./joycond-cemuhook.py:165: DeprecationWarning: There is no current event loop
  tasks.add(asyncio.ensure_future(self._handle_events()))

./joycond-cemuhook.py:169: DeprecationWarning: There is no current event loop
  tasks.add(asyncio.ensure_future(self._get_battery_level()))

./joycond-cemuhook.py:172: DeprecationWarning: There is no current event loop
  tasks.add(asyncio.ensure_future(self._wait_for_termination()))

./joycond-cemuhook.py:175: DeprecationWarning: There is no current event loop
  done, pending = asyncio.get_event_loop().run_until_complete(asyncio.wait(tasks, return_when=asyncio.FIRST_COMPLETED))

it keeps working, but what one could do to update the code and avoid the warning?

joaorb64 commented 2 years ago

I believe https://github.com/joaorb64/joycond-cemuhook/pull/61 might have fixed it? Can you confirm it for me?

cipitaua commented 2 years ago

yes the current version seems clean, thank you