Skip to content

Commit

Permalink
If sync recovers, stop using the API again (and log)
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeBishop committed Jan 15, 2025
1 parent faa0e06 commit 47fce92
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/TWCManager/Vehicle/TeslaMateVehicle.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,14 @@ def applyDataToVehicle(self, id, event, payload):
setattr(vehicle, property_name, converter(payload))
vehicle.syncTimestamp = time.time()

# If sync timed out and has recovered, log it
if vehicle.syncSource != "TeslaMateVehicle":
vehicle.syncSource = "TeslaMateVehicle"
logger.info(
"Vehicle "
+ vehicle.name
+ " telemetry has resumed being provided by TeslaMate"
)
else:
# If we don't know this vehicle yet, save the data.
if id not in self.unknownVehicles:
Expand Down

0 comments on commit 47fce92

Please sign in to comment.