Skip to content

Commit

Permalink
Increase cacheTime for vehicle_data to 300, set vehicle lastErrorTime…
Browse files Browse the repository at this point in the history
… at 429 in wakeVehicle()
  • Loading branch information
RichieB2B committed Jun 13, 2024
1 parent 55a2c09 commit 9b30327
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/TWCManager/Vehicle/TeslaAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -1268,7 +1268,7 @@ def wakeVehicle(self, vehicle):
return self.wakeVehicle(vehicle)
elif req.status_code == 429:
# We're explicitly being told to back off
self.errorCount = max(30, self.errorCount)
self.updateCarApiLastErrorTime(vehicle)
return False
except json.decoder.JSONDecodeError:
return False
Expand Down Expand Up @@ -1479,7 +1479,7 @@ def get_car_api(self, url, checkReady=True, provesOnline=True):
self.carapi.updateCarApiLastErrorTime(self)
return (False, None)

def update_location(self, cacheTime=60):
def update_location(self, cacheTime=300):
if self.syncSource == "TeslaAPI":
return self.update_vehicle_data(cacheTime)

Expand All @@ -1490,7 +1490,7 @@ def update_location(self, cacheTime=60):

return True

def update_vehicle_data(self, cacheTime=60):
def update_vehicle_data(self, cacheTime=300):
url = (
"/".join([self.carapi.getCarApiBaseURL(), str(self.VIN), "vehicle_data"])
+ "?endpoints="
Expand Down

0 comments on commit 9b30327

Please sign in to comment.