mirror of
https://github.com/home-assistant/core.git
synced 2025-08-31 10:21:30 +02:00
days ahead
This commit is contained in:
@@ -15,6 +15,8 @@ from . import WorkdayConfigEntry
|
|||||||
from .const import CONF_EXCLUDES, CONF_OFFSET, CONF_WORKDAYS
|
from .const import CONF_EXCLUDES, CONF_OFFSET, CONF_WORKDAYS
|
||||||
from .entity import BaseWorkdayEntity
|
from .entity import BaseWorkdayEntity
|
||||||
|
|
||||||
|
CALENDAR_DAYS_AHEAD = 365
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
@@ -71,7 +73,7 @@ class WorkdayCalendarEntity(BaseWorkdayEntity, CalendarEntity):
|
|||||||
def update_data(self, now: datetime) -> None:
|
def update_data(self, now: datetime) -> None:
|
||||||
"""Update data."""
|
"""Update data."""
|
||||||
event_list = []
|
event_list = []
|
||||||
for i in range(365):
|
for i in range(CALENDAR_DAYS_AHEAD):
|
||||||
future_date = now.date() + timedelta(days=i)
|
future_date = now.date() + timedelta(days=i)
|
||||||
if self.date_is_workday(future_date):
|
if self.date_is_workday(future_date):
|
||||||
event = CalendarEvent(
|
event = CalendarEvent(
|
||||||
|
Reference in New Issue
Block a user