diff --git a/teslajsonpy/BatterySensor.py b/teslajsonpy/BatterySensor.py index cf2d8ab0..f30fcbe6 100644 --- a/teslajsonpy/BatterySensor.py +++ b/teslajsonpy/BatterySensor.py @@ -22,6 +22,7 @@ def __init__(self, data, controller): self.uniq_name = 'Tesla model {} {} {}'.format( str(self.__vin[3]).upper(), self.__vin, self.type) self.bin_type = 0x5 + self.update() def update(self): self.__controller.update(self.__id) diff --git a/teslajsonpy/BinarySensor.py b/teslajsonpy/BinarySensor.py index 326525a0..d581ce55 100644 --- a/teslajsonpy/BinarySensor.py +++ b/teslajsonpy/BinarySensor.py @@ -19,6 +19,7 @@ def __init__(self, data, controller): self.uniq_name = 'Tesla model {} {} {}'.format( str(self.__vin[3]).upper(), self.__vin, self.type) self.bin_type = 0x1 + self.update() def update(self): self.__controller.update(self.__id) diff --git a/teslajsonpy/Charger.py b/teslajsonpy/Charger.py index 61f5d1e7..e5b10d5d 100644 --- a/teslajsonpy/Charger.py +++ b/teslajsonpy/Charger.py @@ -19,6 +19,7 @@ def __init__(self, data, controller): self.uniq_name = 'Tesla model {} {} {}'.format( str(self.__vin[3]).upper(), self.__vin, self.type) self.bin_type = 0x8 + self.update() def update(self): self.__controller.update(self.__id) diff --git a/teslajsonpy/Climate.py b/teslajsonpy/Climate.py index 2bb73179..7f49a1c9 100644 --- a/teslajsonpy/Climate.py +++ b/teslajsonpy/Climate.py @@ -108,6 +108,7 @@ def __init__(self, data, controller): self.uniq_name = 'Tesla model {} {} {}'.format( str(self.__vin[3]).upper(), self.__vin, self.type) self.bin_type = 0x4 + self.update() def get_inside_temp(self): return self.__inside_temp diff --git a/teslajsonpy/GPS.py b/teslajsonpy/GPS.py index d666b538..14bfc6fe 100644 --- a/teslajsonpy/GPS.py +++ b/teslajsonpy/GPS.py @@ -25,6 +25,7 @@ def __init__(self, data, controller): self.uniq_name = 'Tesla model {} {} {}'.format( str(self.__vin[3]).upper(), self.__vin, self.type) + self.update() def get_location(self): return self.__location diff --git a/teslajsonpy/Lock.py b/teslajsonpy/Lock.py index c80dd892..1b70842f 100644 --- a/teslajsonpy/Lock.py +++ b/teslajsonpy/Lock.py @@ -22,7 +22,7 @@ def __init__(self, data, controller): self.uniq_name = 'Tesla model {} {} {}'.format( str(self.__vin[3]).upper(), self.__vin, self.type) self.bin_type = 0x7 - + self.update() def update(self): self.__controller.update(self.__id) diff --git a/teslajsonpy/controller.py b/teslajsonpy/controller.py index 03430c75..7e85b0cc 100644 --- a/teslajsonpy/controller.py +++ b/teslajsonpy/controller.py @@ -65,7 +65,6 @@ def wake_up(self, vehicle_id): def update(self, car_id): cur_time = time.time() if cur_time - self.__last_update_time[car_id] > self.update_interval: - self.wake_up(car_id) data = self.get(car_id, 'data')['response'] self.__climate[car_id] = data['climate_state']