diff --git a/custom_components/luxtronik/sensor.py b/custom_components/luxtronik/sensor.py index 163205e..09b7d61 100644 --- a/custom_components/luxtronik/sensor.py +++ b/custom_components/luxtronik/sensor.py @@ -224,12 +224,18 @@ def _handle_coordinator_update( # evu start if ( self._attr_cache[SA.EVU_FIRST_START_TIME] == time.min - or time_now.hour <= self._attr_cache[SA.EVU_FIRST_START_TIME].hour or ( - self._attr_cache[SA.EVU_SECOND_START_TIME] != time.min - and time_now.hour < self._attr_cache[SA.EVU_SECOND_START_TIME].hour + time_now.hour <= self._attr_cache[SA.EVU_FIRST_START_TIME].hour + or ( + self._attr_cache[SA.EVU_SECOND_START_TIME] != time.min + and time_now.hour < self._attr_cache[SA.EVU_SECOND_START_TIME].hour + ) + or time_now.hour <= self._attr_cache[SA.EVU_FIRST_END_TIME].hour + ) + and ( + self._attr_cache[SA.EVU_FIRST_END_TIME].hour > time_now.hour + or self._attr_cache[SA.EVU_FIRST_END_TIME] == time.min ) - or time_now.hour <= self._attr_cache[SA.EVU_FIRST_END_TIME].hour ): self._attr_cache[SA.EVU_FIRST_START_TIME] = time_now else: