From 15282e40eea70b503350a9e00d9362abd2f629d3 Mon Sep 17 00:00:00 2001 From: "Alan D. Tse" Date: Tue, 22 Oct 2019 00:43:32 -0700 Subject: [PATCH] feat: add vehicle_config --- teslajsonpy/controller.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/teslajsonpy/controller.py b/teslajsonpy/controller.py index a81646c7..74f1a8de 100644 --- a/teslajsonpy/controller.py +++ b/teslajsonpy/controller.py @@ -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 @@ -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']] = {} @@ -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'] @@ -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]