Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve race condition in powerview when discovered by zeroconf and dhcp #50908

Merged
merged 1 commit into from May 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -113,6 +113,7 @@ async def async_step_discovery_confirm(self):
"""Confirm dhcp or homekit discovery."""
# If we already have the host configured do
# not open connections to it if we can avoid it.
self.context[CONF_HOST] = self.discovered_ip
for progress in self._async_in_progress():
if progress.get("context", {}).get(CONF_HOST) == self.discovered_ip:
janiversen marked this conversation as resolved.
Show resolved Hide resolved
return self.async_abort(reason="already_in_progress")
Expand Down Expand Up @@ -140,8 +141,8 @@ async def async_step_link(self, user_input=None):
data={CONF_HOST: self.powerview_config[CONF_HOST]},
)

self.context[CONF_HOST] = self.discovered_ip
self._set_confirm_only()
self.context["title_placeholders"] = self.powerview_config
return self.async_show_form(
step_id="link", description_placeholders=self.powerview_config
)
Expand Down
Expand Up @@ -12,6 +12,7 @@
"description": "Do you want to setup {name} ({host})?"
}
},
"flow_title": "{name} ({host})",
"error": {
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]",
"unknown": "[%key:common::config_flow::error::unknown%]"
Expand Down
Expand Up @@ -7,6 +7,7 @@
"cannot_connect": "Failed to connect",
"unknown": "Unexpected error"
},
"flow_title": "{name} ({host})",
"step": {
"link": {
"description": "Do you want to setup {name} ({host})?",
Expand Down