diff --git a/custom_components/schedule_state/sensor.py b/custom_components/schedule_state/sensor.py index 95e6335..f6c22ae 100644 --- a/custom_components/schedule_state/sensor.py +++ b/custom_components/schedule_state/sensor.py @@ -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) @@ -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 (