* Add google application_credentials platform
* Further simplify custom auth implementation overrides
* Add test coverage in application_credentials
* Simplify wording in a comment
* Remove unused imports accidentally left from merge
* Wrap lines that are too long for style guide
* Move application credential loading to only where it is needed
* Leave CLIENT_ID and CLIENT_SECRET as required.
* Prepare google calendar integration for Application Credentials
Update google calendar integration to have fewer dependencies on
yaml configuration data to prepare for supporting application
credentials, which means setup can happen without configuration.yaml
at all. This pre-factoring will allow the following PR adding
application credentials support to be more focused.
* Add test coverage for device auth checks
* 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
* 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>
* Refresh google calendar tokens with invalid expiration times
* Update tests/components/google/conftest.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Remove unnecessary async methods in functions being touched already
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
* 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
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.
Update google calendar's use of hass.data to follow the best practices of storing
data under hass.data[DOMAIN]. This is in preparation for storing additional
data later, pulled out of a larger cleanup.
* 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>