Skip to content

Commit

Permalink
Update sensor.py
Browse files Browse the repository at this point in the history
  • Loading branch information
reiniertc authored Jun 12, 2024
1 parent d0673e5 commit fc87e96
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions custom_components/magister_rooster/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,12 @@ def name(self):
def update(self):
super().update()
if self._events_tomorrow:
unique_summaries = list(set(self.filter_summary(event[2]) for event in self._events_tomorrow))
self._state = ", ".join(unique_summaries)
filtered_summaries = []
for event in self._events_tomorrow:
summary = self.filter_summary(event[2])
if summary not in filtered_summaries:
filtered_summaries.append(summary)
self._state = ", ".join(filtered_summaries)
else:
self._state = None

Expand Down

0 comments on commit fc87e96

Please sign in to comment.