diff --git a/custom_components/peaqev/peaqservice/chargecontroller/charger/charger.py b/custom_components/peaqev/peaqservice/chargecontroller/charger/charger.py index 5287bf91..57a4c09d 100644 --- a/custom_components/peaqev/peaqservice/chargecontroller/charger/charger.py +++ b/custom_components/peaqev/peaqservice/chargecontroller/charger/charger.py @@ -50,7 +50,6 @@ def charger_active(self) -> bool: ) # todo: composition return all( [ - # self.controller.hub.sensors.chargerobject_switch.value, # todo: possibly remove to allow chargertypes without switch. self.controller.hub.sensors.carpowersensor.value > 0, # todo: composition ] diff --git a/custom_components/peaqev/peaqservice/chargecontroller/ichargecontroller.py b/custom_components/peaqev/peaqservice/chargecontroller/ichargecontroller.py index 504db0a3..0e3be774 100644 --- a/custom_components/peaqev/peaqservice/chargecontroller/ichargecontroller.py +++ b/custom_components/peaqev/peaqservice/chargecontroller/ichargecontroller.py @@ -149,10 +149,18 @@ async def async_check_broadcasting( match new_state: case ChargeControllerStates.Idle: await self.hub.observer.async_broadcast(ObserverTypes.CarDisconnected) + await self.session.async_reset( + getattr( + self.hub.sensors.locale.data.query_model, + 'charged_peak', + 0, + ) + ) if self.hub.charger_done: await self.hub.observer.async_broadcast( ObserverTypes.UpdateChargerDone, False ) + case ChargeControllerStates.Done: await self.hub.observer.async_broadcast(ObserverTypes.UpdateChargerDone, True) case ChargeControllerStates.Charging | ChargeControllerStates.Start | ChargeControllerStates.Stop | ChargeControllerStates.Connected: