Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions custom_components/schedule_state/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,9 @@ async def _build_layers_for_event_unsafe(self, groups, event_idx, event, day):
months = event.get("months", None) or event.get("month", None)
if months is not None:
month_condition = {"condition": "time", "month": months}
conditions.append(month_condition)
# Only add if not already present
if month_condition not in conditions:
conditions.append(month_condition)

# Filter by weekday
weekdays = self._get_weekdays_from_condition(conditions)
Expand Down Expand Up @@ -1130,7 +1132,7 @@ def _serialize_conditions(self, conditions):
# Filter time conditions with months
if (
serializable_cond.get("condition") == "time"
and "month" in serializable_cond
and ("month" in serializable_cond or "weekday" in serializable_cond)
):
clean_conditions.append(serializable_cond)
# elif (
Expand Down
Loading