Migrate hyperion to use async_update_reload_and_abort (#115238)

This commit is contained in:
J. Nick Koston 2024-04-09 06:37:01 -10:00 committed by GitHub
parent 763df83cdb
commit f8aec03c03
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -412,12 +412,7 @@ class HyperionConfigFlow(ConfigFlow, domain=DOMAIN):
entry = await self.async_set_unique_id(hyperion_id, raise_on_progress=False)
if self.context.get(CONF_SOURCE) == SOURCE_REAUTH and entry is not None:
self.hass.config_entries.async_update_entry(entry, data=self._data)
# Need to manually reload, as the listener won't have been installed because
# the initial load did not succeed (the reauth flow will not be initiated if
# the load succeeds)
await self.hass.config_entries.async_reload(entry.entry_id)
return self.async_abort(reason="reauth_successful")
return self.async_update_reload_and_abort(entry, data=self._data)
self._abort_if_unique_id_configured()