From c2ecbde3d0937c0498cae8231f967dcd7dfc8653 Mon Sep 17 00:00:00 2001 From: Florian Bezannier Date: Thu, 25 Mar 2021 23:21:00 +0100 Subject: [PATCH] fix stop hour not being updated --- ChargeControl.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ChargeControl.py b/ChargeControl.py index b693b51..31e6e39 100644 --- a/ChargeControl.py +++ b/ChargeControl.py @@ -73,6 +73,7 @@ class ChargeControl: if status == "InProgress": self.force_update() if level >= self.percentage_threshold and self.retry_count < 2: + logger.info("Charge threshold is reached, stop the charge") self.control_charge_with_ack(False) elif self._next_stop_hour is not None: if self._next_stop_hour < now: @@ -87,6 +88,8 @@ class ChargeControl: thread.setDaemon(True) thread.start() else: + if self._next_stop_hour < now: + self._next_stop_hour += timedelta(days=1) self.retry_count = 0 except AttributeError: logger.error("Probably can't retrieve all information from API: %s", traceback.format_exc())