Commit Graph

33 Commits (f0f0b4b8fa2f1bb04385c9a076adb61d5cae32e4)

Author SHA1 Message Date
Allen Porter 5816342bed
Remove dead code and increase test coverage for google config flow (#128690) 2024-10-19 09:48:36 +02:00
epenet 120e17fa1e
Improve logic for detecting unused ignore translations (#128441) 2024-10-18 17:59:06 +02:00
epenet f41494b7cc
Ensure config_flow abort reasons have translations (#128140)
* Ensure config_flow abort reasons have translations

* Ignore fake_integration in application_credentials

* Mark gardena_bluetooth as needs fixing

* Mark google as needs fixing

* Mark google_assistant_sdk as needs fixing

* Mark homewizard as needs fixing

* Mark homeworks as needs fixing

* Mark honeywell as needs fixing

* Mark jewish_calendar as needs fixing

* Mark lg_netcast as needs fixing

* Mark lifx as needs fixing

* Mark lyric as needs fixing

* Mark madvr as needs fixing

* Mark matter as needs fixing

* Mark melcloud as needs fixing

* Mark motioneye as needs fixing

* Mark ollama as needs fixing

* Mark philips_js as needs fixing

* Mark spotify as needs fixing

* Mark srp_energy as needs fixing

* Mark subaru as needs fixing

* Mark tplink as needs fixing

* Mark yolink as needs fixing

* Mark youtube as needs fixing

* Fix incorrect comment
2024-10-14 16:39:10 +02:00
epenet 99335a07e5
Use start_reauth helper method in integration tests (e-g) (#124785)
* Use start_reauth helper method in integration tests (e-g)

* Include fireservicerota
2024-08-28 15:47:57 +02:00
epenet 25d33e96cc
Add missing hass type hint in component tests (g) (#124203) 2024-08-19 00:29:26 -07:00
epenet b949240d4a
Improve type hints in google tests (#121169) 2024-07-04 05:56:01 -07:00
epenet 5f309b69cf
Add type hints to current_request_with_host in tests (#119054) 2024-06-07 11:40:23 +02:00
epenet b81f0b600f
Move current_request_with_host fixture to decorator (#118810)
* Move current_request_with_host fixture to decorator

* One more
2024-06-04 17:50:22 +02:00
Marc Mueller 3cd1717437
Improve YieldFixture typing (#117686) 2024-05-18 12:35:02 +02:00
Joost Lekkerkerker b9281327c4
Use FlowResultType enum in config flow tests A-M (#114681) 2024-04-03 09:21:17 +02:00
Joost Lekkerkerker 906d3198e3
Use is in enum comparison in config flow tests F-J (#114670)
* Use right enum expression F-J

* Fix
2024-04-02 23:01:37 +02:00
Erik Montnemery ddf3a36061
Improve calls to async_show_progress in google (#107788) 2024-01-11 16:47:53 +01:00
Jan-Philipp Benecke 0ae0331c5c
Migrate google related tests to use freezegun (#105552)
* Migrate google related tests to use freezegun

* retrigger CI

* Fix google tests

* Add timezone to config_entry_token_expiry

* Separate config_entry_token_expiry from token_expiry

* Also test token refresh for offset-naive tokens

* retrigger CI

* Apply code review suggestion

Co-authored-by: Allen Porter <allen.porter@gmail.com>

* Run ruff-format

---------

Co-authored-by: Allen Porter <allen.porter@gmail.com>
2023-12-21 12:23:01 +01:00
Allen Porter 3f70437888
Add support to Google Calendar for Web auth credentials (#103570)
* Add support to Google Calendar for webauth credentials

* Fix broken import

* Fix credential name used on import in test

* Remove unnecessary creds domain parameters

* Remove unnecessary guard to improve code coverage

* Clarify comments about credential preferences

* Fix typo

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-11-10 22:49:10 -08:00
Franck Nijhof ed79265843
Enable Ruff PT006 (#88165)
* Enable Ruff PT006

* Adjust existing cases

* Fix tests

* Remove unneeded parentheses
2023-02-15 14:09:50 +01:00
Allen Porter 4d186366bd
Improve Google Calendar config flow error message when API disabled (#87889) 2023-02-12 18:28:44 +01:00
Allen Porter 5d1ca73a34
Add create and delete for Google Calendar events (#83034)
* 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>
2022-12-01 21:39:58 +01:00
Allen Porter f34de5072a
Bump gcal_sync to 4.0.1 to fix Google Calendar config flow (#81873)
Bump gcal_sync to 4.0.1

This reverts test chagnes from PR #81562 that were actually incorrect given
the calendar "get" API returns less information that the "CalendarList" api.
2022-11-09 19:34:31 -08:00
Allen Porter 2ad1d31119
Bump gcal_sync to 4.0.0 (#81562)
* Bump gcal_sync to 2.2.4

* Bump gcal sync to 4.0.0

* Add Calendar accessRole fields which are now required
2022-11-05 17:06:34 -07:00
Allen Porter 8280b8422c
Remove google calendar configuration.yaml deprecated in 2022.6 (#77814) 2022-09-05 21:12:38 +02:00
Allen Porter ca5065a627
Improve google calendar config flow timeout error messages (#75364) 2022-07-18 11:44:51 +02:00
Allen Porter 02d1676301
Fix unexpected exception in Google Calendar OAuth exchange (#73963) 2022-06-28 13:29:11 -07: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 bdc41bf22a
Fix google calendar bug where expired tokens are not refreshed (#72994) 2022-06-03 16:33:12 -07: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 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
Franck Nijhof 9d377aabdb
Fix Google tests (#72158) 2022-05-19 14:11:29 +02:00
Allen Porter 26ee289be3
Add return code to integration application credentials in config flow (#71986)
* Add return code to integration application credentials in config flow

* Update google tests to use new return code

* Update spotify test for no auth configured

* Add translation for oauth2_missing_credentials

* Add new return code to yolink

* Update homeassistant/strings.json

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

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-05-18 06:30:57 -07: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 1cce0a5744
Fix bugs calendar oauth token date handling (#69641) 2022-04-07 21:53:30 -07: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