mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 11:47:06 +00:00
Add back description and location to calendar endpoint (#71887)
This commit is contained in:
parent
b6c7422607
commit
690fb2ae86
@ -341,6 +341,8 @@ class CalendarEventView(http.HomeAssistantView):
|
||||
[
|
||||
{
|
||||
"summary": event.summary,
|
||||
"description": event.description,
|
||||
"location": event.location,
|
||||
"start": _get_api_date(event.start),
|
||||
"end": _get_api_date(event.end),
|
||||
}
|
||||
|
@ -39,6 +39,8 @@ def calendar_data_future() -> CalendarEvent:
|
||||
start=one_hour_from_now,
|
||||
end=one_hour_from_now + datetime.timedelta(minutes=60),
|
||||
summary="Future Event",
|
||||
description="Future Description",
|
||||
location="Future Location",
|
||||
)
|
||||
|
||||
|
||||
@ -90,6 +92,8 @@ class LegacyDemoCalendar(CalendarEventDevice):
|
||||
).isoformat()
|
||||
},
|
||||
"summary": "Future Event",
|
||||
"description": "Future Description",
|
||||
"location": "Future Location",
|
||||
}
|
||||
|
||||
@property
|
||||
|
@ -937,5 +937,7 @@ async def test_get_events_custom_calendars(hass, calendar, get_api_events):
|
||||
"end": {"dateTime": "2017-11-27T10:00:00-08:00"},
|
||||
"start": {"dateTime": "2017-11-27T09:00:00-08:00"},
|
||||
"summary": "This is a normal event",
|
||||
"location": "Hamburg",
|
||||
"description": "Surprisingly rainy",
|
||||
}
|
||||
]
|
||||
|
@ -57,3 +57,5 @@ async def test_events_http_api_shim(hass, hass_client):
|
||||
assert response.status == HTTPStatus.OK
|
||||
events = await response.json()
|
||||
assert events[0]["summary"] == "Future Event"
|
||||
assert events[0]["description"] == "Future Description"
|
||||
assert events[0]["location"] == "Future Location"
|
||||
|
@ -79,4 +79,6 @@ async def test_api_events(
|
||||
"start": {"date": "2022-01-06"},
|
||||
"end": {"date": "2022-01-06"},
|
||||
"summary": "Christmas Tree Pickup",
|
||||
"description": None,
|
||||
"location": None,
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user