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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UniFi temp fix to handle runtime data #120031

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions homeassistant/components/unifi/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,14 @@
abort_reason = "reauth_successful"

if config_entry:
hub = config_entry.runtime_data
try:
hub = config_entry.runtime_data

if hub and hub.available:
return self.async_abort(reason="already_configured")
if hub and hub.available:
return self.async_abort(reason="already_configured")

except AttributeError:
pass

Check warning on line 174 in homeassistant/components/unifi/config_flow.py

View check run for this annotation

Codecov / codecov/patch

homeassistant/components/unifi/config_flow.py#L173-L174

Added lines #L173 - L174 were not covered by tests

return self.async_update_reload_and_abort(
config_entry, data=self.config, reason=abort_reason
Expand Down