Skip to content

Commit

Permalink
feat: add vehicle_config
Browse files Browse the repository at this point in the history
  • Loading branch information
alandtse committed Oct 22, 2019
1 parent 98b238b commit 15282e4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions teslajsonpy/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def __init__(self, email, password, update_interval):
self.__climate = {}
self.__charging = {}
self.__state = {}
self.__config = {}
self.__driving = {}
self.__gui = {}
self._last_update_time = {} # succesful attempts by car
Expand All @@ -72,6 +73,7 @@ def __init__(self, email, password, update_interval):
self.__climate[car['id']] = {}
self.__charging[car['id']] = {}
self.__state[car['id']] = {}
self.__config[car['id']] = {}
self.__driving[car['id']] = {}
self.__gui[car['id']] = {}

Expand Down Expand Up @@ -404,6 +406,7 @@ def update(self, car_id=None, wake_if_asleep=False, force=False):
self.__climate[car_id] = response['climate_state']
self.__charging[car_id] = response['charge_state']
self.__state[car_id] = response['vehicle_state']
self.__config[car_id] = response['vehicle_config']
self.__driving[car_id] = response['drive_state']
self.__gui[car_id] = response['gui_settings']
self.car_online[car_id] = (response['state']
Expand All @@ -424,6 +427,10 @@ def get_state_params(self, car_id):
"""Return cached copy of state_params for car_id."""
return self.__state[car_id]

def get_config_params(self, car_id):
"""Return cached copy of state_params for car_id."""
return self.__config[car_id]

def get_drive_params(self, car_id):
"""Return cached copy of drive_params for car_id."""
return self.__driving[car_id]
Expand Down

0 comments on commit 15282e4

Please sign in to comment.