* Add Google Calendar create/delete support
Includes editing for recurring events
* Fix default calendar access role
* Formatting improvements
* Address other details that have changed due to local sync
* Update tests/components/google/test_calendar.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update tests/components/google/test_calendar.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update tests/components/google/test_calendar.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Increase test coverage
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Revert google calendar back to old API for free/busy readers
* Update homeassistant/components/google/calendar.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Sync google calendar and serve from local storage
Update to use new gcal_sync APIs
Update google calendar filter logic
Remove storage on config entry removal
Make timeline queries timezone aware
Do not block startup while syncing
* Minor readability tweaks
* Remove unnecessary args to async_add_entities
* Change how task is created on startup
* Update homeassistant/components/google/calendar.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Revert min time between updates
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Support multiple config entries at once
* Add test coverage for multiple config entries
* Add support for multiple config entries to google config flow
* Clear hass.data when unloading config entry
* Make google config flow defensive against reuse of the same account
* Assign existing google config entries a unique id
* Migrate entities to new unique id format
* Support muliple accounts per oauth client id
* Fix mypy typing errors
* Hard fail to keep state consistent, removing graceful degredation
* Remove invalid entity regsitry entries
* Stop updating google_calendars.yaml if it does not already exist
* Add additional test coverage to make CI pass
* Add test for no updates to google_calendar.yaml
* Add parameter to test for expecting write calls
* Missing call argument
* Remove conditional and replace with inline assert
* Switch to google calendar async iterator api
* Update homeassistant/components/google/calendar.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Add test coverage for paging through results
* Bump gcal_sync to 0.6.1
* Bump gcal-sync 0.6.2
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Use new aiohttp based google client library in gcal_sync.
* Use base url in tests for shorter string
* Remove unnecessary line of code
* Jump to gcal-sync-0.4.1
* Update tests/components/google/conftest.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update to gcal_sync 0.5.0 incorporating PR feedback
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Move the offset reached computation outside of the update method so that it is
computed when state updates occur rather than when data refreshes happen (which
are throttled and happen at most every 15 minutes).
Issue #69892
Add test coverage for the calendar event response format as I am about to do some
refactoring and simplification. Notably, each calendar implementation uses a slightly different
API response, and this is codifying that.
* Make google calendar loading API centric, not loading from yaml
Update the behavior for google calendar to focus on loading calendars based on the
API and using the yaml configuration to override behavior. The old behavior was
to first load from yaml, then also load from the API, which is atypical.
This is pulled out from a larger change to rewrite calendar using async and config
flows.
Tests needed to be updated to reflect the new API centric behavior, and changing
the API call ordering required changing tests that exercise failures.
* Update to use async_fire_time_changed to invoke updates
* Improve google calendar test quality and share setup
Improve google calendar test quality by exercising different combinations of
cases and new coverage. The existing test cases do achieve very high coverage,
however some of the subtle interactions between the components are not as well
exercised, which is needed when we start changing how the internal code is
structured moving to async or to config entries.
Ipmrovement include:
- Exercising additional cases around different types of configuration parameters
that control how calendars are tracked or not tracked. The tracking can be
configured in google_calendars.yaml, or by defaults set in configuration.yaml
for new calendars.
- Share even more test setup, used when exercising the above different scenarios
- Add new test cases for event creation.
- Improve test readability by making more clear the differences between tests
exercising yaml and API test calendars. The data types are now more clearly
separated in the two cases, as well as the entity names created in the two
cases.
* Undo some diffs for readability
* Improve pydoc readability
* Improve pydoc readability
* Incorporate improvements from Martin
* Make test parameters a State instance
* Update test naming to be more correct
* Fix flake8 errors
Simplify google calendar authentication to combine some of the cases together, and reduce unecessarily checks. Make the
tests share common authentication setup and reduce use of mocks by introducing a fake for holding on to credentials.
This makes future refactoring simpler, so we don't have to care as much about the interactions with the credentials
storage.
* Improve google calendar test coverage to 97%
* Remove commented out code.
* Remove unnecessary (flaky) checks for token file persistence
* Remove mock code assertions
* Add debug logging to google calendar integration
* Increase alarm time to polling code to reduce flakes
* Setup every test in their own configuration directory
* Mock out filesystem calls to avoid disk dependencies
Update scope checking code to use Storage object rather than text file matching
* Update tests to check entity states when integration is loaded
* Mock out google service in multiple locations
* Update homeassistant/components/google/__init__.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/google/__init__.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Use f-strings in integrations starting with F
* Use f-strings in tests for integrations starting with F
* Use f-strings in integrations starting with G
* Use f-strings in tests for integrations starting with G
* Fix pylint error
* Fix broken test
* Correct google calendar test name
* Rewrite calendar component
* Save component in hass.data.
* Rename device_state_attributes to state_attributes.
* Remove offset attribute from base state_attributes.
* Extract offset helpers to calendar component.
* Clean imports.
* Remove stale constants.
* Remove name and add async_get_events.
* Add normalize_event helper function. Copied from #21495.
* Add event property to base entity.
* Use event property for calendar state.
* Ensure event start and end.
* Remove entity init.
* Add comment about event data class.
* Temporary keep old start and end datetime format.
* Convert demo calendar
* Convert google calendar
* Convert google calendar.
* Clean up google component.
* Keep offset feature by using offset helpers.
* Convert caldav calendar
* Clean up caldav calendar.
* Update caldav cal on addition.
* Bring back offset to caldav calendar.
* Copy caldav event on update.
* Convert todoist calendar
* Clean and fix google calendar tests
* Extract test calendar constant for google test
* Rewrite google calendar tests
* Clean and fix google calendar tests
* Clean and fix google component tests
* Add google conftest
* Skip flaky google calendar test
* Fix google calendar bug
* Fix yield fixture
* Set fixture names to avoid lint warning
* Fix yield fixture