From 83cb4853faf87f765c09f701f490a4174f5248a2 Mon Sep 17 00:00:00 2001 From: Florian Bezannier Date: Thu, 31 Dec 2020 00:46:14 +0100 Subject: [PATCH] fix charge controlv2 --- ChargeControl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChargeControl.py b/ChargeControl.py index 2aa8def..123da73 100644 --- a/ChargeControl.py +++ b/ChargeControl.py @@ -56,7 +56,7 @@ class ChargeControl: logger.info(f"charging status of {self.vin} is {status}, battery level: {level}") if status == "InProgress": # force update if the car doesn't send info during 10 minutes - last_update = datetime.strptime(res.energy[0].updated_at, "%Y-%m-%dT%H:%M:%SZ") + last_update = res.energy[0].updated_at 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: