mirror of
https://github.com/home-assistant/core.git
synced 2025-08-30 09:51:37 +02:00
Fixes
This commit is contained in:
@@ -97,4 +97,8 @@ class WorkdayCalendarEntity(BaseWorkdayEntity, CalendarEntity):
|
||||
self, hass: HomeAssistant, start_date: datetime, end_date: datetime
|
||||
) -> list[CalendarEvent]:
|
||||
"""Get all events in a specific time frame."""
|
||||
return self.event_list
|
||||
return [
|
||||
workday
|
||||
for workday in self.event_list
|
||||
if start_date.date() <= workday.start <= end_date.date()
|
||||
]
|
||||
|
@@ -40,14 +40,15 @@ async def test_holiday_calendar_entity(
|
||||
SERVICE_GET_EVENTS,
|
||||
{
|
||||
"entity_id": "calendar.workday_sensor_calendar",
|
||||
"end_date_time": dt_util.now() + timedelta(hours=1),
|
||||
"start_date_time": dt_util.now(),
|
||||
"end_date_time": dt_util.now() + timedelta(days=10, hours=1),
|
||||
},
|
||||
blocking=True,
|
||||
return_response=True,
|
||||
)
|
||||
assert {
|
||||
"end": "2023-01-01",
|
||||
"start": "2023-01-02",
|
||||
"end": "2023-01-02",
|
||||
"start": "2023-01-01",
|
||||
"summary": "Workday Sensor",
|
||||
} not in response["calendar.workday_sensor_calendar"]["events"]
|
||||
assert {
|
||||
|
Reference in New Issue
Block a user