Use new config entry update/abort helper in synology_dsm (#108682)

pull/108688/head
J. Nick Koston 2024-01-22 11:39:57 -10:00 committed by GitHub
parent 07926660bc
commit 4bf4bc7e9b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 6 deletions

View File

@ -220,13 +220,12 @@ class SynologyDSMFlowHandler(ConfigFlow, domain=DOMAIN):
config_data[CONF_VOLUMES] = user_input[CONF_VOLUMES]
if existing_entry:
self.hass.config_entries.async_update_entry(
existing_entry, data=config_data
reason = (
"reauth_successful" if self.reauth_conf else "reconfigure_successful"
)
return self.async_update_reload_and_abort(
existing_entry, data=config_data, reason=reason
)
await self.hass.config_entries.async_reload(existing_entry.entry_id)
if self.reauth_conf:
return self.async_abort(reason="reauth_successful")
return self.async_abort(reason="reconfigure_successful")
return self.async_create_entry(title=friendly_name or host, data=config_data)