don't stop the charge if threshold=100

This commit is contained in:
Florian Bezannier
2021-10-02 11:29:51 +02:00
parent 97c136ca15
commit 42d5e06399
+2 -2
View File
@@ -69,7 +69,7 @@ class ChargeControl:
status = vehicle_status.get_energy('Electric').charging.status
level = vehicle_status.get_energy('Electric').level
logger.info("charging status of %s is %s, battery level: %d", self.vin, status, level)
if status == "InProgress":
if status == "InProgress" and self.percentage_threshold < 100:
self.force_update()
if level >= self.percentage_threshold and self.retry_count < 2:
logger.info("Charge threshold is reached, stop the charge")
@@ -92,7 +92,7 @@ class ChargeControl:
self.retry_count = 0
except (AttributeError, ValueError):
logger.exception("Probably can't retrieve all information from API:")
except: # pylint: disable=bare-except
except: # pylint: disable=bare-except
logger.exception("Charge control:")
def get_dict(self):