From e577172832b01b57b615360882dce78c79a923fb Mon Sep 17 00:00:00 2001 From: G Johansson Date: Wed, 13 Aug 2025 19:45:04 +0000 Subject: [PATCH] days ahead --- homeassistant/components/workday/calendar.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/workday/calendar.py b/homeassistant/components/workday/calendar.py index 5eaee68ae3e..5e72835d742 100644 --- a/homeassistant/components/workday/calendar.py +++ b/homeassistant/components/workday/calendar.py @@ -15,6 +15,8 @@ from . import WorkdayConfigEntry from .const import CONF_EXCLUDES, CONF_OFFSET, CONF_WORKDAYS from .entity import BaseWorkdayEntity +CALENDAR_DAYS_AHEAD = 365 + async def async_setup_entry( hass: HomeAssistant, @@ -71,7 +73,7 @@ class WorkdayCalendarEntity(BaseWorkdayEntity, CalendarEntity): def update_data(self, now: datetime) -> None: """Update data.""" event_list = [] - for i in range(365): + for i in range(CALENDAR_DAYS_AHEAD): future_date = now.date() + timedelta(days=i) if self.date_is_workday(future_date): event = CalendarEvent(