mlowijs / tesla_api

Lightweight Python API client for the Tesla API.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error with empty credentials

Dreamsorcerer opened this issue · comments

If the login credentials are empty strings, it hits this error instead of the normal AuthenticationError:

Traceback (most recent call last):
  File "tesla.py", line 42, in on_login
    vehicles = self.client.list_vehicles()
  File "/usr/local/lib/python3.6/dist-packages/tesla_api/__init__.py", line 90, in list_vehicles
    return [Vehicle(self, vehicle) for vehicle in self.get('vehicles')]
  File "/usr/local/lib/python3.6/dist-packages/tesla_api/__init__.py", line 68, in get
    self.authenticate()
  File "/usr/local/lib/python3.6/dist-packages/tesla_api/__init__.py", line 56, in authenticate
    expiry_time = timedelta(seconds=self._token['expires_in'])
KeyError: 'expires_in'