Skip to content

Commit

Permalink
UniFi temp fix to handle runtime data (#120031)
Browse files Browse the repository at this point in the history
Co-authored-by: Franck Nijhof <[email protected]>
  • Loading branch information
Kane610 and frenck authored Jun 21, 2024
1 parent eba429d commit 94800cb
Showing 1 changed file with 7 additions and 3 deletions.
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 @@ async def async_step_site(
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

0 comments on commit 94800cb

Please sign in to comment.