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 28e3567
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/TWCManager/Vehicle/TeslaAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -1269,6 +1269,7 @@ def wakeVehicle(self, 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 +1480,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 +1491,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 28e3567

Please sign in to comment.