Skip to content

Commit

Permalink
fixing slow execution
Browse files Browse the repository at this point in the history
  • Loading branch information
zabuldon committed Sep 18, 2017
1 parent d047de3 commit 3130f73
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions teslajsonpy/BatterySensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions teslajsonpy/BinarySensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions teslajsonpy/Charger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions teslajsonpy/Climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions teslajsonpy/GPS.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion teslajsonpy/Lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion teslajsonpy/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down

0 comments on commit 3130f73

Please sign in to comment.