NickWaterton / Roomba980-Python

Python program and library to control iRobot Roomba 980 Vacuum Cleaner
MIT License
377 stars 106 forks source link

AttributeError: type object '_asyncio.Task' has no attribute 'all_tasks' #130

Closed bruh1555 closed 3 months ago

bruh1555 commented 3 months ago

please help me error:

tasks = [t for t in asyncio.Task.all_tasks() if t is not asyncio.Task.current_task()] ^^^^^^^^^^^^^^^^^^^^^^ AttributeError: type object '_asyncio.Task' has no attribute 'all_tasks'

NickWaterton commented 3 months ago

What version of Python are you using? This is likely the issue. asyncio.Task.all_tasks() was removed in Python 3.7. Replaced by asyncio.all_tasks(). Same for current_task().

So, the line should be:

tasks = [t for t in asyncio.all_tasks() if t is not asyncio.current_task()]

Can you paste the full log? I did update to run with Python 3.10 last year, but missed this.

bruh1555 commented 3 months ago

I am running python 3.12.4. Also, am i able to run this code on a roomba 694? I have to run it on my newer version because if i run it on the roomba 694 it gives me this error: Connection Error: [SSL: UNSAFE_LEGACY_RENEGOTIATION_DISABLED] unsafe legacy renegotiation disabled (_ssl.c:1000) Attempting retry Connection# 0 Connection Error: [SSL: UNSAFE_LEGACY_RENEGOTIATION_DISABLED] unsafe legacy renegotiation disabled (_ssl.c:1000) Attempting retry Connection# 1 Connection Error: [SSL: UNSAFE_LEGACY_RENEGOTIATION_DISABLED] unsafe legacy renegotiation disabled (_ssl.c:1000) Attempting retry Connection# 2 Connection Error: [SSL: UNSAFE_LEGACY_RENEGOTIATION_DISABLED] unsafe legacy renegotiation disabled (_ssl.c:1000)

bruh1555 commented 3 months ago

Ah, fixed it, both of them. All i had to do was change some ssh rules and change the line to what you said. Thanks!