diff --git a/custom_components/goecharger_api2/pygoecharger_ha/__init__.py b/custom_components/goecharger_api2/pygoecharger_ha/__init__.py index 6019c19..1c28f4f 100644 --- a/custom_components/goecharger_api2/pygoecharger_ha/__init__.py +++ b/custom_components/goecharger_api2/pygoecharger_ha/__init__.py @@ -79,24 +79,12 @@ async def read_all_states(self): # copy all fields from 'idle_states' to self._states self._states.update(idle_states) - # self._states[Tag.ERR.key] = idle_states[Tag.ERR.key] - # self._states[Tag.NRG.key] = idle_states[Tag.NRG.key] - # self._states[Tag.TMA.key] = idle_states[Tag.TMA.key] - # self._states[Tag.CAR.key] = idle_states[Tag.CAR.key] - # self._states[Tag.MODELSTATUS.key] = idle_states[Tag.MODELSTATUS.key] - # - # if self._REQUEST_IDS_DATA: - # self._states[Tag.PGRID.key] = idle_states[Tag.PGRID.key] - # self._states[Tag.PAKKU.key] = idle_states[Tag.PAKKU.key] - # self._states[Tag.PPV.key] = idle_states[Tag.PPV.key] - # self._REQUEST_IDS_DATA = False - # - # if include_times: - # list=FILTER_TIMES_ADDON.split(',') - # for a_key in list: - # if a_key in idle_states: - # self._states[a_key] = idle_states[a_key] + # reset the '_REQUEST_IDS_DATA' flag (will be enabled again, if we post new PV data to the + # wallbox) + if self._REQUEST_IDS_DATA: + self._REQUEST_IDS_DATA = False + # chck, if the car idle state have changed to something else if Tag.CAR.key in self._states and self._states[Tag.CAR.key] != CAR_VALUES.IDLE.value: # the car state is not 'idle' - so we should fetch all states... await self.read_all_states()