mirror of
https://github.com/home-assistant/developers.home-assistant.git
synced 2025-07-16 13:56:29 +00:00
OAuth discovery
This commit is contained in:
parent
9822f0fd5b
commit
e12118d762
@ -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
|
## Additional resources
|
||||||
|
|
||||||
To learn more information about config flows, checkout the [config flow documentation](/docs/config_entries_config_flow_handler).
|
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
|
## Related rules
|
||||||
|
|
||||||
<RelatedRules relatedRules={frontMatter.related_rules}></RelatedRules>
|
<RelatedRules relatedRules={frontMatter.related_rules}></RelatedRules>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user