diff --git a/custom_components/peaqev/manifest.json b/custom_components/peaqev/manifest.json index bd7b7c62..46e72a72 100644 --- a/custom_components/peaqev/manifest.json +++ b/custom_components/peaqev/manifest.json @@ -23,7 +23,7 @@ "iot_class": "calculated", "issue_tracker": "https://github.com/elden1337/hass-peaq/issues", "requirements": [ - "peaqevcore==19.0.0a38" + "peaqevcore==19.0.0a41" ], "version": "3.0.0b1" } diff --git a/custom_components/peaqev/peaqservice/hub/hub.py b/custom_components/peaqev/peaqservice/hub/hub.py index ec2622e0..03f71123 100644 --- a/custom_components/peaqev/peaqservice/hub/hub.py +++ b/custom_components/peaqev/peaqservice/hub/hub.py @@ -324,11 +324,12 @@ def charger_done(self) -> bool: async def async_update_prices(self, prices: list) -> None: if self.options.price.price_aware: await self.hours.async_update_prices(prices[0], prices[1]) - await self.hours.async_update_max_min( - max_charge=self.max_min_controller.max_charge, - car_connected=self.chargecontroller.connected, - session_energy=self.chargecontroller.session.session_energy, - ) + if self.max_min_controller.is_on: + await self.hours.async_update_max_min( + max_charge=self.max_min_controller.max_charge, + car_connected=self.chargecontroller.connected, + session_energy=self.chargecontroller.session.session_energy, + ) async def async_update_average_monthly_price(self, val) -> None: if self.options.price.price_aware and isinstance(val, float): diff --git a/custom_components/peaqev/peaqservice/hub/max_min_controller.py b/custom_components/peaqev/peaqservice/hub/max_min_controller.py index feb3499f..db4cdf3e 100644 --- a/custom_components/peaqev/peaqservice/hub/max_min_controller.py +++ b/custom_components/peaqev/peaqservice/hub/max_min_controller.py @@ -13,6 +13,7 @@ class MaxMinController: def __init__(self, hub: HomeAssistantHub): self.hub: HomeAssistantHub = hub self.active: bool = hub.options.price.price_aware + self.is_on:bool = False self._override_max_charge = None self._original_total_charge = 0 self.override_max_charge: bool = False @@ -28,9 +29,11 @@ def max_charge(self) -> int: if self.active: if self._override_max_charge is not None: """overridden by frontend""" + self.is_on = True return self._override_max_charge if self.hub.options.max_charge > 0: """set in config flow""" + self.is_on = True return self.hub.options.max_charge return self._original_total_charge