mlowijs / tesla_api

Lightweight Python API client for the Tesla API.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem to login

tomdddd opened this issue · comments

All,

I am new in programming & using APIs.
I tried the example to connect by a python program on raspberry PI to my tesla but I get this error:
What is the problem... ?

Traceback (most recent call last):
File "/home/pi/Mijnprogs/Python/Basis python/Tesla_communication.py", line 15, in
asyncio.run(main())
File "/usr/lib/python3.7/asyncio/runners.py", line 43, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
return future.result()
File "/home/pi/Mijnprogs/Python/Basis python/Tesla_communication.py", line 7, in main
vehicles = await client.list_vehicles()
File "/home/pi/.local/lib/python3.7/site-packages/tesla_api/init.py", line 104, in list_vehicles
return [_class(self, vehicle) for vehicle in await self.get('vehicles')]
File "/home/pi/.local/lib/python3.7/site-packages/tesla_api/init.py", line 80, in get
await self.authenticate()
File "/home/pi/.local/lib/python3.7/site-packages/tesla_api/init.py", line 68, in authenticate
expiry_time = timedelta(seconds=self.token['expires_in'])
KeyError: 'expires_in'

I'm still updating the code for the new auth as per the other issues opened here.

You can try out the in-progress code in this branch: #39