hacf-fr / renault-api

https://readthedocs.org/projects/renault-api/
MIT License
102 stars 34 forks source link

AttributeError: 'NoneType' object has no attribute 'totalMileage' #1158

Closed Biocef closed 2 months ago

Biocef commented 2 months ago

Hi,

I have an issue since a couple of days :

renault-api status

charge-mode: Access is denied for this resource Traceback (most recent call last): File "/home/pi/.local/bin/renault-api", line 8, in sys.exit(main()) File "/home/pi/.local/lib/python3.9/site-packages/click/core.py", line 1157, in call return self.main(args, kwargs) File "/home/pi/.local/lib/python3.9/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) File "/home/pi/.local/lib/python3.9/site-packages/click/core.py", line 1688, in invoke return_process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/pi/.local/lib/python3.9/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, ctx.params) File "/home/pi/.local/lib/python3.9/site-packages/click/core.py", line 783, in invoke return __callback(args, kwargs) File "/home/pi/.local/lib/python3.9/site-packages/click/decorators.py", line 45, in new_func return f(get_current_context().obj, *args, *kwargs) File "/home/pi/.local/lib/python3.9/site-packages/renault_api/cli/helpers.py", line 39, in wrapper asyncio.run(run_command(func, args, kwargs)) File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete return future.result() File "/home/pi/.local/lib/python3.9/site-packages/renault_api/cli/helpers.py", line 30, in run_command await func(*args, **kwargs) File "/home/pi/.local/lib/python3.9/site-packages/renault_api/cli/main.py", line 178, in status await renault_vehicle.display_status(websession, ctx_data) File "/home/pi/.local/lib/python3.9/site-packages/renault_api/cli/renault_vehicle.py", line 159, in display_status await update_cockpit(vehicle, status_table, ctx_data) File "/home/pi/.local/lib/python3.9/site-packages/renault_api/cli/renault_vehicle.py", line 267, in update_cockpit ("Total mileage", response.totalMileage, "km"), AttributeError: 'NoneType' object has no attribute 'totalMileage'

How can I resolve this issue ? Thank's for your help !

epenet commented 2 months ago

Did you try the latest version?

slyoldfox commented 2 months ago

was seeing the same thing here on 0.2.1

pip install renault-api==0.2.2

fixed it for me

Biocef commented 2 months ago

Did you try the latest version?

Yes, I'm already on 0.2.2

Edit : It's okay after a reboot ! Thanks :)

Biocef commented 2 months ago

A reboot after apply the update resolve the issue.