Skip to content

Commit

Permalink
more fixy
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeDurrant committed Mar 7, 2020
1 parent beaf716 commit d589d34
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions teslajson.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

class Connection(object):
"""Connection to Tesla Motors API"""
__version__ = "1.7.0"
__version__ = "1.7.1"

def __init__(self,
email='',
Expand Down Expand Up @@ -64,6 +64,7 @@ def __init__(self,
self.proxy_url = proxy_url
self.proxy_user = proxy_user
self.proxy_password = proxy_password
tesla_client = json.loads(tesla_client)
self.current_client = tesla_client['v1']
self.baseurl = self.current_client['baseurl']
self.api = self.current_client['api']
Expand Down Expand Up @@ -101,7 +102,7 @@ def post(self, command, data={}):
now = calendar.timegm(datetime.datetime.now().timetuple())
if now > self.expiration:
auth = self.__open("/oauth/token", data=self.oauth)
self.__sethead(auth['access_token'],
self._sethead(auth['access_token'],
auth['created_at'] + auth['expires_in'] - 86400)
return self.__open("%s%s" % (self.api, command), headers=self.head, data=data)

Expand Down Expand Up @@ -199,7 +200,7 @@ def data(self, name='data'):

def data_request(self, name):
"""Get vehicle data_request"""
return self.data(name, 'data_request/%s' % name)
return self.data('data_request/%s' % name)

def wake_up(self):
"""Wake the vehicle"""
Expand Down

0 comments on commit d589d34

Please sign in to comment.