* Update calendar tests to use mock entities instead of demo platform
* Add Generator type to fixture
* Fix generator syntax
---------
Co-authored-by: Martin Hjelmare <[email protected]>
* deprecate calendar.list_events
* rename events to get_events
* raise issue for use of deprecated service
* Make issue fixable
* Add fix_flow
* Add service translation/yaml
* Limit fields returned for the list events service
* Update websocket tests and fix bugs in response fields
* Omit 'None' fields in the list events response
* Add service response data for listing calendar events
Add the capability of response data for for the entity component.
* Rename input arguments and add service description
* Improve list events to be more user friendly
Allow the end date to be determined based on a relative time duration. Make the start time optional and set to "now". Add additional test coverage. Update demo calendar to actually perform date range checks.
* Wrap docstrings properly.
* Increase test coverage
* Update to use new API calls
* Readability improvements
* Wrap docstrings
* Require at least one of end or duration
* Check for multiple entity matches earlier in the request
* Update documentation strings
Update the calander event trigger logic to have more exhaustive coverage. The
trigger will now use a timespan to create an explicit window for considering
upcoming events. The start/end of the time span is now more explicit, rather
than getting it from the alarm time.
The trigger is now broken into composable pieces:
- A timespan object for more explicitly managing the time window
- A function to get events during a time span
- A function to process upcoming events and determine the trigger times
The existing listener is now just responsible for scheduling alarms and glue.
This fixes bug with DST handling where the conversion back and forth between
UTC and timezone ends up dropping events during the jump forward. In practice,
an event was returned from the scanning, but it was never fired by the trigger
because (1) it was filtered out of the interval and (2) the event list was
previously cleared every iteration so it would get dropped.
Future improvements can bake more invariant checking into this structure.
* Add update support for calendars and implement in local calendar
* Fix supported feature for update calendar
* Increase test coverage for websocket error cases
* Improve test coverage for update failure cases
* Improve test coverage by sharing code between update and create
* Update homeassistant/components/calendar/__init__.py
Co-authored-by: Martin Hjelmare <[email protected]>
Co-authored-by: Martin Hjelmare <[email protected]>
* Add support for calendar trigger offsets
* Add offset end test
* Update homeassistant/components/calendar/trigger.py
Co-authored-by: Martin Hjelmare <[email protected]>
* Always include offset in trigger data
Co-authored-by: Martin Hjelmare <[email protected]>
* 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 <[email protected]>
* Remove logging f-strings, and move to main code
* Remove mypy ignore
* Apply suggestions from code review
Co-authored-by: Martin Hjelmare <[email protected]>
* Update calendar triggers to use new calendar data model
* Update tests/components/calendar/test_trigger.py
Co-authored-by: Franck Nijhof <[email protected]>
* 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 <[email protected]>
* Update homeassistant/components/calendar/trigger.py
Co-authored-by: Martin Hjelmare <[email protected]>
* Increase test coverage based on pr feedback
Co-authored-by: Martin Hjelmare <[email protected]>
Co-authored-by: Franck Nijhof <[email protected]>
* Introduce data class to hold calendar event data
* Rename CalendarEventDevice to CalendarEntity
* Apply suggestions from code review
Co-authored-by: Martin Hjelmare <[email protected]>
* 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 <[email protected]>