Skip to content

Commit

Permalink
fixed #249
Browse files Browse the repository at this point in the history
  • Loading branch information
Gifford47 authored Nov 18, 2024
1 parent 934202d commit f1dcdd7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions custom_components/luxtronik/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,17 @@ def _handle_coordinator_update(
super()._handle_coordinator_update(data)
time_now = time(datetime.now().hour, datetime.now().minute)
evu = LuxOperationMode.evu.value
weekday = datetime.today().weekday()
if not isinstance(self._attr_cache[SA.EVU_DAYS], list):
weekday = datetime.today().weekday()
if isinstance(self._attr_cache[SA.EVU_DAYS], str):
self._attr_cache[SA.EVU_DAYS] = self._attr_cache[SA.EVU_DAYS].split(',')
elif not isinstance(self._attr_cache[SA.EVU_DAYS], list):
self._attr_cache[SA.EVU_DAYS] = list()
if self._attr_native_value is None or self._last_state is None:
pass
elif self._attr_native_value == evu and str(self._last_state) != evu:
# evu start
if weekday not in self._attr_cache[SA.EVU_DAYS]:
self._attr_cache[SA.EVU_DAYS].append(weekday)
if (
self._attr_cache[SA.EVU_FIRST_START_TIME] == time.min
or (
Expand Down

0 comments on commit f1dcdd7

Please sign in to comment.