Home Assistant has improved best practices for Calendar entities to ensure that calendar triggers/automations and the UI work correctly in all cases.
In particular, there are now more documented expectations and enforcement of invariants including:
endis exclusive. e.g. An all day event that lasts one day should have an end date with 1 day after the start date.
CalendarEventcan accept a
datetimein any timezone. Floating dates without a timezone are not allowed.
CalendarEventinvariants are now enforced when created.
- Events returned by
async_get_eventsare expected to be returned in order.
- All Day events returned by
async_get_eventsmust be evaluated in the Home Assistant local timezone. That is, an all day event should be ordered as if it starts at midnight in the local time.
The Calendar Entity developer documentation has been updated with additional detail.