* Add support for calendar trigger offsets
* Add offset end test
* Update homeassistant/components/calendar/trigger.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Always include offset in trigger data
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Add initial implementation of calendar trigger
This is an initial implementation of a calendar trigger, that supports
triggering on calendar start time.
See architecture proposal in:
https://github.com/home-assistant/architecture/discussions/700
* Address reviewer feedback
* Use f-strings for all tests
* Apply suggestions from code review
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Remove logging f-strings, and move to main code
* Remove mypy ignore
* Apply suggestions from code review
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update calendar triggers to use new calendar data model
* Update tests/components/calendar/test_trigger.py
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
* Rewrite tests using freezegun
Rewrite tests using freezegun and improve edge case handling, and use utc consistently for all alarms.
* Update homeassistant/components/calendar/trigger.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/calendar/trigger.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Increase test coverage based on pr feedback
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
* Introduce data class to hold calendar event data
* Rename CalendarEventDevice to CalendarEntity
* Apply suggestions from code review
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Fix docstring on google calendar api conversion function.
* Update todoist to new calendar enttiy api, tested manually
* Add back old API for a legacy compatibility layer
* Add deprecation warning for old calendar APIs
* Fix deprecation warning
* Fix merge for missing summary #69520
* Add mypy typing for newly introduced classes
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Simplify the calendar offset calculations to no longer update the event dictionary
using extra fields. calculate_offset is renamed to extract_offset and the integration
is responsible for overwriting the summary text.
This is in prepration for:
- Improved calendar event typing, removing unnecessary offset_reached field
- Calendar triggers which will remove offsets anyway