mirror of
https://github.com/flobz/psa_car_controller.git
synced 2026-08-22 01:16:14 +00:00
fix stop hour not being updated
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user