mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Gracefully handle caldav event with missing summary (#84719)
fixes undefined
This commit is contained in:
parent
580f2058a7
commit
128ccbaa57
@ -184,7 +184,7 @@ class WebDavCalendarData:
|
||||
continue
|
||||
event_list.append(
|
||||
CalendarEvent(
|
||||
summary=vevent.summary.value,
|
||||
summary=self.get_attr_value(vevent, "summary") or "",
|
||||
start=vevent.dtstart.value,
|
||||
end=self.get_end_date(vevent),
|
||||
location=self.get_attr_value(vevent, "location"),
|
||||
@ -264,7 +264,9 @@ class WebDavCalendarData:
|
||||
return
|
||||
|
||||
# Populate the entity attributes with the event values
|
||||
(summary, offset) = extract_offset(vevent.summary.value, OFFSET)
|
||||
(summary, offset) = extract_offset(
|
||||
self.get_attr_value(vevent, "summary") or "", OFFSET
|
||||
)
|
||||
self.event = CalendarEvent(
|
||||
summary=summary,
|
||||
start=vevent.dtstart.value,
|
||||
|
@ -214,6 +214,18 @@ DESCRIPTION:The bell tolls for thee
|
||||
RRULE:FREQ=HOURLY;INTERVAL=1;COUNT=12
|
||||
END:VEVENT
|
||||
END:VCALENDAR
|
||||
""",
|
||||
"""BEGIN:VCALENDAR
|
||||
VERSION:2.0
|
||||
PRODID:-//Global Corp.//CalDAV Client//EN
|
||||
BEGIN:VEVENT
|
||||
UID:14
|
||||
DTSTAMP:20151125T000000Z
|
||||
DTSTART:20151127T000000Z
|
||||
DTEND:20151127T003000Z
|
||||
RRULE:FREQ=HOURLY;INTERVAL=1;COUNT=12
|
||||
END:VEVENT
|
||||
END:VCALENDAR
|
||||
""",
|
||||
]
|
||||
|
||||
@ -917,7 +929,7 @@ async def test_get_events(hass, calendar, get_api_events):
|
||||
await hass.async_block_till_done()
|
||||
|
||||
events = await get_api_events("calendar.private")
|
||||
assert len(events) == 14
|
||||
assert len(events) == 15
|
||||
assert calendar.call
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user