Use new reauth helpers in skybell (#128741)

This commit is contained in:
epenet 2024-10-19 14:44:06 +02:00 committed by GitHub
parent 8a16504988
commit 10b04f41df
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -34,16 +34,11 @@ class SkybellFlowHandler(ConfigFlow, domain=DOMAIN):
errors = {} errors = {}
if user_input: if user_input:
password = user_input[CONF_PASSWORD] password = user_input[CONF_PASSWORD]
entry_id = self.context["entry_id"]
if entry := self.hass.config_entries.async_get_entry(entry_id):
_, error = await self._async_validate_input(self.reauth_email, password) _, error = await self._async_validate_input(self.reauth_email, password)
if error is None: if error is None:
self.hass.config_entries.async_update_entry( return self.async_update_reload_and_abort(
entry, self._get_reauth_entry(), data_updates=user_input
data=entry.data | user_input,
) )
await self.hass.config_entries.async_reload(entry.entry_id)
return self.async_abort(reason="reauth_successful")
errors["base"] = error errors["base"] = error
return self.async_show_form( return self.async_show_form(