Skip to content

Commit

Permalink
restore single day entries
Browse files Browse the repository at this point in the history
  • Loading branch information
s-kurz committed Oct 9, 2024
1 parent 012baaf commit 2afb44c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions custom_components/luxtronik/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,18 +449,18 @@ def _wd_txt(self, value: list) -> str:
return ','.join(days)

def _restore_attr_value(self, value: Any | None) -> Any:
if value is not None:
if ',' in str(value):
vals = list()
for day in str(value).split(","):
for idx, name in enumerate(calendar.day_name):
if day == name:
vals.append(idx)
break
return vals
if value is not None:
if ":" in str(value):
vals = str(value).split(":")
return time(int(vals[0]), int(vals[1]))
vals = list()
for day in str(value).split(","):
for idx, name in enumerate(calendar.day_name):
if day == name:
vals.append(idx)
break
if len(vals):
return vals
return time.min


Expand Down

0 comments on commit 2afb44c

Please sign in to comment.