From e12118d76238c6ff628f7118c36834976585e7b1 Mon Sep 17 00:00:00 2001 From: Simon Lamon <32477463+silamon@users.noreply.github.com> Date: Wed, 28 May 2025 21:44:09 +0200 Subject: [PATCH] OAuth discovery --- .../integration-quality-scale/rules/discovery.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/core/integration-quality-scale/rules/discovery.md b/docs/core/integration-quality-scale/rules/discovery.md index d5541ee3..d197fbb2 100644 --- a/docs/core/integration-quality-scale/rules/discovery.md +++ b/docs/core/integration-quality-scale/rules/discovery.md @@ -110,6 +110,18 @@ class MyConfigFlow(ConfigFlow, domain=DOMAIN): ) ``` +### Note for OAuth2-Based Config Flows + +For integrations that utilize OAuth2 and extend config_entry_oauth2_flow.AbstractOAuth2FlowHandler instead of ConfigFlow, it is not necessary to implement discovery-related steps such as async_step_zeroconf or async_step_discovery_confirm. The AbstractOAuth2FlowHandler base class includes built-in support for Home Assistant's discovery mechanisms and will automatically initiate the configuration flow when a compatible device or service is detected. Developers need only declare the relevant discovery identifiers in manifest.json and implement the async_oauth_create_entry method to complete the configuration. + +Certainly! Here's a revised version that refers more generally to Home Assistant's discovery mechanisms: + + +### Note for OAuth2-Based Config Flows + +For integrations that utilize OAuth2 and extend `config_entry_oauth2_flow.AbstractOAuth2FlowHandler` instead of `ConfigFlow`, it is not necessary to implement discovery-related steps such as `async_step_zeroconf` or `async_step_discovery_confirm`. The `AbstractOAuth2FlowHandler` base class includes built-in support for Home Assistant's discovery mechanisms and will automatically initiate the configuration flow when a compatible device or service is detected. Developers need only declare the relevant discovery identifiers in `manifest.json` and implement the `async_oauth_create_entry` method to complete the configuration. + + ## Additional resources To learn more information about config flows, checkout the [config flow documentation](/docs/config_entries_config_flow_handler). @@ -123,4 +135,4 @@ Integrations where the devices can't be discovered are exempt from this rule. ## Related rules - \ No newline at end of file +