Commit Graph

25 Commits (66494b0238b8dc8ab3f2671fc126c172a91de2fc)

Author SHA1 Message Date
Allen Porter cc543b200d
Update `nest` config flow to dramatically simplify end user setup with automated pub/sub subscription creation (#59260)
* Configure nest pubsub subscriber automatically

Update the config flow to configure the nest pubsub subscriber automatically.
After completing the authentication step, the user is now asked for the google
cloud console ID, which is needed to create a subscription.

Home Assistant manages the lifecycle of a subscription only when it is created
by the ConfigFlow. Otherwise (if specified in configuration.yaml) it treats
it similarly as before.

These are the considerations or failure modes taken into account:
- Subscription is created with reasonable default values as previously recommended (e.g. retion only keeps 5-15 minutes of backlog messages)
- Subscriptions are created with a naming scheme that makes it clear they came from home assistant, and with a random
  string
- Subscriptions are cleaned up when the ConfigEntry is removed. If removal fails, a subscription that is orphaned will
  be deleted after 30 days
- If the subscription gets into a bad state or deleted, the user can go through the re-auth flow to re-create it.
- Users can still specifcy a CONF_SUBSCRIBER_ID in the configuration.yaml, and
skip automatic subscriber creation

* Remove unnecessary nest config flow diffs and merge in upstream changes

* Incorporate review feedback into nest subscription config flow

* Update text wording in nest config flow
2021-11-29 22:41:29 -08:00
Allen Porter fa4e890696
Revamp nest authentication config flows and remove need for redirect urls (#59033)
* Add support for Installed Auth authentication flows.

Add support for additional credential types to make configuration simpler for
end users. The existing Web App auth flow requires users to configure
redirect urls with Google that has a very high security bar: requires ssl,
and a publicly resolvable dns name.

The new Installed App flow requires the user to copy/paste an access code
and is the same flow used by the `google` calendar integration. This also
allows us to let users create one authentication credential to use with
multiple google integrations.

* Remove hard migration for nest config entries, using soft migration

* Add comment explaining soft migration

* Revet changes to common.py made obsolete by removing migration

* Reduce unnecessary diffs in nest common.py

* Update config entries using library method

* Run `python3 -m script.translations develop`

* Revert nest auth domain

* Remove compat function which is no longer needed

* Remove stale nest comment

* Adjust typing for python3.8

* Address PR feedback for nest auth revamp
2021-11-04 15:56:16 -07:00
J. Nick Koston 10d6247fee
Bump to aiohttp 3.8.0 (#58974) 2021-11-04 10:07:50 -05:00
Allen Porter 6376b4be5c
Increase static type coverage for nest integration (#53475)
Co-authored-by: Mick Vleeshouwer <mick@imick.nl>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-07-27 01:43:52 +02:00
Allen Porter 1fe2d0f9c8
Address style issues in nest typing (#53236)
* Add additional types for config flow

Fixing style errors introduced by partial typing in pr #53214

* Address typing style errors

Make all functions fully typed, follow up to pr #53214
2021-07-20 17:41:48 +02:00
Allen Porter c2a2f50316
mypy cleanup for homeassistant.components.nest (#53214) 2021-07-20 07:59:31 +02:00
J. Nick Koston a4ea9b3cd3
Update usage of async_entries to use _async_current_entries (#50187) 2021-05-12 12:47:06 +02:00
J. Nick Koston 671aabf9f4
Remove unused imports in fritz, nest, and somfy to fix CI (#49940) 2021-04-30 21:58:48 -10:00
Franck Nijhof a6206b2819
Clean up connection classes in integrations M-O (#49892) 2021-04-30 21:03:37 -10:00
Franck Nijhof e1a3ef3d69
Clean up config entry handlers decorator from config flows (#49932) 2021-04-30 23:28:25 +02:00
Marc Mueller 3d2b81a401
Update typing 11 (#48072) 2021-03-18 13:21:46 +01:00
Allen Porter 81341bbf91
Handle expiration of nest auth credentials (#44202)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-12-20 01:41:29 +01:00
springstan 5a892e8fca
Add unknown_authorize_url_generation to base strings for config flows (#42484) 2020-11-24 12:00:16 -05:00
Allen Porter 0c852b5f81
Update nest integration with fixes from initial PR (#42250) 2020-10-24 20:48:28 +02:00
Allen Porter 52b66e88c7
Update Nest integration to support Google Nest Device Access (new API) (#41689)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-10-21 10:17:49 +02:00
J. Nick Koston 965bb2c8df
Update nest to use async_add_executor_job (#41926) 2020-10-16 13:31:16 +02:00
Christian Bilevits 1c4512bc40
Use common strings in Nest config flow (#41597) 2020-10-11 14:47:30 +02:00
springstan eae21be5b9
Improve string formatting v6 (#33698) 2020-04-07 23:14:28 +02:00
Bas Nijholt 186799794d Sort imports according to PEP8 for nest (#29670) 2019-12-09 12:08:51 +01:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
Paulus Schoutsen 201fd4afee Add config entries to connection class (#16618) 2018-09-17 10:12:46 +02:00
Jason Hu f58425dd3c Refactor data entry flow (#15883)
* Refactoring data_entry_flow and config_entry_flow

Move SOURCE_* to config_entries
Change data_entry_flow.FlowManager.async_init() source param default
 to None
Change this first step_id as source or init if source is None
_BaseFlowManagerView pass in SOURCE_USER as default source

* First step of data entry flow decided by _async_create_flow() now

* Lint

* Change helpers.config_entry_flow.DiscoveryFlowHandler default step

* Change FlowManager.async_init source param to context dict param
2018-08-09 13:24:14 +02:00
Ville Skyttä b7c336a687 Pylint cleanups (#15626)
* Pylint 2 no-else-return fixes

* Remove unneeded abstract-class-not-used pylint disable
2018-07-23 10:16:05 +02:00
Paulus Schoutsen 8a777f6e78
Show notification when user configures Nest client_id/secret (#14970)
* Show notification when user configures Nest client_id/secret

* Lint
2018-06-15 15:19:58 -04:00
Paulus Schoutsen e014a84215
Nest config flow (#14921)
* Move nest to dir based component

* Add config flow for Nest

* Load Nest platforms via config entry

* Add tests for Nest config flow

* Import existing access tokens as config entries

* Lint

* Update coverage

* Update translation

* Fix tests

* Address strings

* Use python-nest token resolution

* Lint

* Do not do I/O inside constructor

* Lint

* Update test requirements
2018-06-13 11:14:52 -04:00