Added uid to events added to calendar (#2710)

* Added uid to events added to calendar

uid was missing from events being added to the local calendar. This leads to other systems (eg. Google calendar) not being able to import the calendar due to all events having the same uid of 'None'

* reformatting

---------

Co-authored-by: 5ila5 <5ila5@users.noreply.github.com>
This commit is contained in:
JonReed
2024-09-20 11:19:20 +01:00
committed by GitHub
parent d7e865a9d6
commit ed5fc43d1b

View File

@@ -1,6 +1,7 @@
"""Calendar platform support for Waste Collection Schedule."""
import logging
import uuid
from datetime import datetime, timedelta
from homeassistant.components.calendar import CalendarEntity, CalendarEvent
@@ -107,6 +108,7 @@ class WasteCollectionCalendar(CalendarEntity):
summary=collection.type,
start=collection.date,
end=collection.date + timedelta(days=1),
uid=uuid.uuid4(),
)