Commit Graph

209 Commits (176eb010166458905bac4def46db0a327fd22e5f)

Author SHA1 Message Date
GitHub Action 296e52d918 [ci skip] Translation update 2022-08-21 00:24:25 +00:00
GitHub Action 21cd2f5db7 [ci skip] Translation update 2022-08-20 00:23:43 +00:00
epenet 4a84a8caa9
Use Platform enum (#76967) 2022-08-18 10:22:49 +02:00
GitHub Action d2e5d91eba [ci skip] Translation update 2022-08-18 00:25:40 +00:00
GitHub Action ff3fd4c29d [ci skip] Translation update 2022-08-16 00:30:51 +00:00
GitHub Action bec8e544f4 [ci skip] Translation update 2022-08-14 00:25:47 +00:00
Allen Porter b969ed00b9
Fix google calendar disabled entity handling (#76699)
Fix google calendar disable entity handling
2022-08-13 15:02:32 +02:00
GitHub Action 7c81f790a7 [ci skip] Translation update 2022-08-12 00:23:47 +00:00
GitHub Action 519d478d61 [ci skip] Translation update 2022-08-11 00:26:23 +00:00
GitHub Action 4a938ec33e [ci skip] Translation update 2022-08-10 00:23:36 +00:00
GitHub Action 32a2999b85 [ci skip] Translation update 2022-08-06 00:24:46 +00:00
GitHub Action cb46441b74 [ci skip] Translation update 2022-08-05 00:28:51 +00:00
GitHub Action e2e277490b [ci skip] Translation update 2022-08-04 00:27:38 +00:00
GitHub Action 81e3ef03f7 [ci skip] Translation update 2022-08-02 00:27:42 +00:00
GitHub Action c4ad6d46ae [ci skip] Translation update 2022-07-30 00:22:48 +00:00
GitHub Action a1d96175a8 [ci skip] Translation update 2022-07-29 00:25:31 +00:00
GitHub Action 0317cbb388 [ci skip] Translation update 2022-07-28 00:25:05 +00:00
GitHub Action 33c635809c [ci skip] Translation update 2022-07-27 00:28:57 +00:00
Allen Porter 47713d9686
Raise issue for Google Calendar YAML deprecations (#75743) 2022-07-26 09:52:15 +02:00
GitHub Action 4a50010458 [ci skip] Translation update 2022-07-25 00:25:55 +00:00
GitHub Action 8e86124470 [ci skip] Translation update 2022-07-23 00:25:17 +00:00
GitHub Action 36138afb93 [ci skip] Translation update 2022-07-22 00:29:27 +00:00
GitHub Action 87797c8b66 [ci skip] Translation update 2022-07-21 00:26:18 +00:00
GitHub Action c29bd48373 [ci skip] Translation update 2022-07-20 00:22:51 +00:00
GitHub Action ebabaeb364 [ci skip] Translation update 2022-07-19 00:29:06 +00:00
Allen Porter ca5065a627
Improve google calendar config flow timeout error messages (#75364) 2022-07-18 11:44:51 +02:00
GitHub Action a3fd5acf3f [ci skip] Translation update 2022-07-13 00:27:34 +00:00
Allen Porter f4e61eff18
Add update coordinator for google calendar (#74690)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-07-10 21:24:52 -07:00
Allen Porter 6f9fcdff99
Improve calendar error handling to match best practices (#74891) 2022-07-10 10:04:57 -07:00
J. Nick Koston cd03c49fc2
Wait for config entry platform forwards (#73806) 2022-07-09 17:27:42 +02:00
Allen Porter 08d8304a52
Migrate google calendar to new entity naming (#74727)
* Migrate google calendar to new entity naming

* Update homeassistant/components/google/calendar.py

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2022-07-08 07:59:50 -07:00
Allen Porter 561c9a77d8
Add google calendar service proper exception handling (#74686) 2022-07-07 20:50:19 -07:00
GitHub Action 405d323709 [ci skip] Translation update 2022-07-08 00:27:47 +00:00
GitHub Action f5fe210eca [ci skip] Translation update 2022-06-29 00:23:03 +00:00
Allen Porter 02d1676301
Fix unexpected exception in Google Calendar OAuth exchange (#73963) 2022-06-28 13:29:11 -07:00
epenet dc039f5218
Use standard argument name in async_step_reauth (#74137) 2022-06-28 17:12:32 +02:00
epenet b6676df1cb
Adjust config-flow reauth type hints in components (#74088) 2022-06-28 08:43:06 +02:00
GitHub Action 11ec8b9186 [ci skip] Translation update 2022-06-27 00:25:49 +00:00
GitHub Action ba64d9db64 [ci skip] Translation update 2022-06-26 00:28:21 +00:00
GitHub Action 0166816200 [ci skip] Translation update 2022-06-25 00:24:25 +00:00
GitHub Action c607994fbe [ci skip] Translation update 2022-06-24 00:23:27 +00:00
GitHub Action 33c263d09b [ci skip] Translation update 2022-06-23 00:20:13 +00:00
GitHub Action 78dd522ccd [ci skip] Translation update 2022-06-22 00:26:36 +00:00
Allen Porter d399815bea
Allow multiple google calendar config entries (#73715)
* 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
2022-06-21 06:42:41 -07:00
Allen Porter ab95299150
Bump gcal_sync to 0.10.0 and fix `google` typing (#73710)
Bump gcal_sync to 0.10.0
2022-06-19 20:16:07 +02:00
GitHub Action dcf6c2d3a4 [ci skip] Translation update 2022-06-19 00:23:14 +00:00
GitHub Action d43178db06 [ci skip] Translation update 2022-06-17 00:20:34 +00:00
GitHub Action b4359c7721 [ci skip] Translation update 2022-06-16 00:22:45 +00:00
GitHub Action a1637e4fce [ci skip] Translation update 2022-06-12 00:25:33 +00:00
GitHub Action c74159109a [ci skip] Translation update 2022-06-10 00:25:26 +00:00
Allen Porter 91cd61804e
Deprecate google calendar add_event service, replaced with entity service (#72473)
* Deprecate google calendar add_event service, replaced with entity service

* Fix inconsistencies and bugs in input validation

* Update validation rules and exceptions

* Resolve merge conflicts
2022-06-09 16:08:08 +02:00
GitHub Action 8f8c1348ba [ci skip] Translation update 2022-06-09 00:23:40 +00:00
Allen Porter e74c711ef3
Add application credentials description strings (#73014) 2022-06-08 07:09:32 -07:00
Allen Porter 9d933e732b
Remove google scan_for_calendars service and simplify platform setup (#73010)
* Remove google scan_for_calendars service and simplify platform setup

* Update invalid calendar yaml test
2022-06-03 21:56:53 -07:00
Allen Porter bdc41bf22a
Fix google calendar bug where expired tokens are not refreshed (#72994) 2022-06-03 16:33:12 -07:00
GitHub Action 7746715590 [ci skip] Translation update 2022-06-02 00:27:51 +00:00
GitHub Action 362f5720ed [ci skip] Translation update 2022-05-31 00:23:11 +00:00
GitHub Action 3c5b778ee3 [ci skip] Translation update 2022-05-30 00:27:06 +00:00
Allen Porter e7e48cd9f6
Defer google calendar integration reload to a task to avoid races of reload during setup (#72608) 2022-05-28 20:28:22 -07:00
Allen Porter a598cdfeb3
Don't import google calendar user pref for disabling new entities (#72652) 2022-05-28 12:51:40 -07:00
Allen Porter 371dfd85c8
Reduce the scope of the google calendar track deprecation (#72575) 2022-05-27 11:52:24 +02:00
Allen Porter 71bc650ac7
Stop updating google_calendars.yaml if it does not already exist (#72340)
* 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
2022-05-25 08:59:27 +02:00
GitHub Action 301341a49f [ci skip] Translation update 2022-05-25 00:26:18 +00:00
GitHub Action abbfed24a4 [ci skip] Translation update 2022-05-24 00:25:27 +00:00
GitHub Action 7df7e33d17 [ci skip] Translation update 2022-05-23 00:25:42 +00:00
Allen Porter e6ffae8bd3
Deprecate google calendar configuration.yaml (#72288)
* Deprecate google calendar configuration.yaml

* Remove unused translations

* Enable strict type checking and address pr feedback

* Move default hass.data init to `async_setup`
2022-05-22 14:29:11 -07:00
Allen Porter 3f8c896cb2
Set user friendly name for Google Calendar config entry (#72243)
* Set user friendly name for Google Calendar config entry

* Add a new auth implementation for use during the config flow
2022-05-21 20:22:27 +02:00
Allen Porter b38289ee50
Remove google found_calendar service (#72260)
* Remove google found_calendar service

* Partial revert of yaml changes

* Store calendar id in a local variable
2022-05-21 08:39:41 -07:00
GitHub Action ceb8bb4745 [ci skip] Translation update 2022-05-21 00:22:49 +00:00
Allen Porter 5866bf48da
Bump gcal_sync to 0.9.0 (#72237) 2022-05-20 18:07:02 +02:00
Allen Porter 3526252cfc
Bump gcal-sync to 0.8.1 (#72164) 2022-05-19 08:16:49 -07:00
GitHub Action 3a13ffcf13 [ci skip] Translation update 2022-05-19 00:26:11 +00:00
GitHub Action 37f81b261d [ci skip] Translation update 2022-05-16 00:24:28 +00:00
Allen Porter f2da1fceb2
Bump gcal_sync to 0.8.0 (#71900) 2022-05-15 19:33:46 +02:00
GitHub Action 10624e93c8 [ci skip] Translation update 2022-05-15 00:30:16 +00:00
Allen Porter 355445db2d
Add application credentials platform for google calendar integration (#71808)
* 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.
2022-05-14 10:27:47 -07:00
Allen Porter 32e4046435
Prepare google calendar integration for Application Credentials (#71748)
* 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
2022-05-13 04:33:52 +02:00
Allen Porter b97ca8e260
Bump gcal_sync to 0.7.1 to fix calendar API timezone handling (#71173) 2022-05-01 14:20:44 -07:00
Allen Porter c8ea264db8
Bump gcal_sync to 0.7.0 (#71116) 2022-04-30 19:33:30 +03:00
GitHub Action 348016dbbf [ci skip] Translation update 2022-04-29 00:22:21 +00:00
Allen Porter 474087bf7d
Bump gcal_sync 0.6.3 to fix calendar path encoding bug (#70959) 2022-04-27 21:17:25 -07:00
Allen Porter 8a13c6744a
Bump gcal_sync to 0.6.2 and switch to google calendar async iterator api (#70616)
* 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>
2022-04-27 07:22:15 -07:00
Allen Porter 0e0c0ce22b
Move google calendar integration to aiohttp (#70173)
* 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>
2022-04-20 20:18:24 -07:00
Allen Porter 36bb947cdf
Fix bug in google calendar offset calculation (#70024)
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
2022-04-13 19:04:59 -07:00
Allen Porter 2543f18e70
Fix google calendar timestamp out of range (#69863) 2022-04-11 20:02:22 +02:00
Allen Porter f99b6004ea
Cleanup calendar APIs and introduce a dataclass for representing events (#68843)
* 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>
2022-04-10 12:04:07 -07:00
Allen Porter a063f55c82
Handle expired credentials in reauth in google calendar initialization (#69772)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-04-09 23:01:48 -07:00
Allen Porter 06d2aeec6b
Refresh google calendar tokens with invalid expiration times (#69679)
* 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>
2022-04-08 20:27:58 -07:00
Allen Porter 1cce0a5744
Fix bugs calendar oauth token date handling (#69641) 2022-04-07 21:53:30 -07:00
Allen Porter 10a1b1f734
Gracefully handle empty summary in google calendar (#69520)
Gracefully handle empty summary in google calendar matching the old behavior
before some code cleanup.
2022-04-07 08:26:07 +02:00
Allen Porter c07100e519
Move Local OAuth http endpoint registration to auth component (#69507) 2022-04-06 22:34:31 -07:00
Allen Porter 3c478c312a
Fix google calendar blocking call, running outside of executor (#68948) 2022-03-31 13:22:33 +02:00
epenet e362871499
Prettify json (strings.json) (#68885) 2022-03-30 10:35:30 +02:00
Allen Porter f61c911174
Remove some offset complexity from calendar event (#68724)
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
2022-03-27 10:02:19 -07:00
Marc Mueller 911b159281
Cleanup after pylint update (#68657) 2022-03-26 00:34:12 +01:00
Allen Porter 7876ffe9e3
Update google calendar integration with a config flow (#68010)
* Convert google calendar to config flow and async

* Call correct exchange method

* Fix async method and reduce unnecessary diffs

* Wording improvements

* Reduce unnecessary diffs

* Run load/update config from executor

* Update homeassistant/components/google/calendar.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Remove unnecessary updating of unexpected multiple config entries.

* Remove unnecessary unique_id checks

* Improve readability with comments about device code expiration

* Update homeassistant/components/google/calendar.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/google/calendar.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/google/api.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Add comment for when code is none on timeout

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-03-15 07:51:02 +01:00
Allen Porter 8adcd10f55
Make google calendar loading API centric, not loading from yaml (#67722)
* 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
2022-03-08 21:56:49 +01:00
Allen Porter 74c339eb7b
Simplify google calendar new calendar tracking (#67772)
* Simplify google calendar new calendar tracking

* Remove application of CONFIG_SCHEMA
2022-03-07 09:44:32 +01:00
Allen Porter a8842d3636
Bump httplib2 to 0.20.4 (#67552) 2022-03-03 15:22:11 -08:00
Allen Porter c456b4c646
Fix google calendar comment typo (#67389) 2022-02-28 18:52:52 +01:00