mlowijs / tesla_api

Lightweight Python API client for the Tesla API.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with authenticate call

techguy993 opened this issue · comments

Hi, just trying to run you for example to get the vehicles/vin and this error occurs:


Traceback (most recent call last):
File "myv.py", line 12, 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 "myv.py", line 6, in main
vehicles = await client.list_vehicles()
File "/Kubernetes/tesla_api-master/tesla_api/init.py", line 119, in list_vehicles
return [Vehicle(self, vehicle) for vehicle in await self.get("vehicles")]
File "/Kubernetes/tesla_api-master/tesla_api/init.py", line 91, in get
await self.authenticate()
File "/Kubernetes/tesla_api-master/tesla_api/init.py", line 81, in authenticate
expiry_time = timedelta(seconds=self._token["expires_in"])
KeyError: 'expires_in'


I thought the module would authenticate or re-authenticate as needed? But the "expires_in key is missing.

Any help would be appreciated?

running python 3.7.3 on Raspbian 32-bit.

See other issues. There are auth problems etc. since Tesla messed with the API. I haven't got round to trying to get it fully working again yet. #39 was a start, but I think the API may have changed again since then...

It's on my list, after some aiohttp maintenance tasks.