Skip to content

Commit

Permalink
convert evu_days of type string to list
Browse files Browse the repository at this point in the history
  • Loading branch information
s-kurz committed Nov 8, 2024
1 parent 31bb5ed commit 7346b20
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions custom_components/luxtronik/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,10 @@ def _calc_next_evu_event_minutes(self) -> int | None:
return None
evu_hours = (24 if evu_time < time_now else 0) + evu_time.hour
weekday = datetime.today().weekday()
if not isinstance(self._attr_cache[SA.EVU_DAYS], list):
self._attr_cache[SA.EVU_DAYS] = list()
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()
evu_pause = 0
if not self._attr_cache[SA.EVU_DAYS] and weekday not in self._attr_cache[SA.EVU_DAYS]:
evu_pause += (24 - datetime.now().hour)*60 - datetime.now().minute
Expand Down

0 comments on commit 7346b20

Please sign in to comment.