mirror of
https://github.com/flobz/psa_car_controller.git
synced 2026-08-21 17:06:18 +00:00
fix charge controlv4
This commit is contained in:
+1
-1
@@ -60,7 +60,7 @@ class ChargeControl:
|
||||
if status == "InProgress":
|
||||
# force update if the car doesn't send info during 10 minutes
|
||||
last_update = res.energy[0].updated_at.replace(tzinfo=pytz.UTC)
|
||||
if (datetime.utcnow().replace(tzinfo=None) - last_update).total_seconds() > 60 * 10:
|
||||
if (datetime.utcnow() - last_update).total_seconds() > 60 * 10:
|
||||
self.psacc.wakeup(self.vin)
|
||||
if (level >= self.percentage_threshold and self.retry_count < 2) or stop_charge:
|
||||
self.psacc.charge_now(self.vin, False)
|
||||
|
||||
Reference in New Issue
Block a user