Add option to ignore flows#30008
Merged
Merged
Conversation
|
Hey there @home-assistant/core, mind taking a look at this pull request as its been labeled with a integration ( |
Member
|
@balloob Looking good! I’ve pushed a branch to my github that adds async_set_unique_id to homekit_controller, will try and finish this off ASAP. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Add option to create "ignored" config entries. Can be created based off any config flow in progress that have a unique ID set. Includes websocket API for this too.
Hue has been updated to still show the ignored hosts as options to configure when starting a manual configuration.
Config entry that is ignored will not be set up and thus not be passed to
async_setup_entry.@bramkragten will work on a UI piece for this.
Only config flows that have unique IDs can be ignored. Since it depends per integration on what is a unique ID, we can't automatically fill this in. Each integration needs to add it themselves. Example of Hue inside
ssdpandhomekit:https://github.com/home-assistant/home-assistant/blob/58b5833d64cd66401d313206595ce582125f8f9f/homeassistant/components/hue/config_flow.py#L167-L168
Calling
self.async_set_unique_idwill by default abort the current config flow if another config flow is already in progress. To abort if the unique ID is part of a config entry, callself._abort_if_unique_id_configured().I am not 100% sure yet if this is the right abstraction or that we can move the "abort if in progress" part to the
self._abort_if…call. I'll revisit this pattern if a few more config flows are updated.Builds on top of #29806 and #30000.
CC @Jc2k
Related issue (if applicable): fixes home-assistant/architecture#250
Pull request with documentation for home-assistant.io (if applicable): TBD
Checklist:
tox. Your PR cannot be merged unless tests passIf the code does not interact with devices: