Use reauth helpers in litterrobot (#128659)
This commit is contained in:
parent
1d24bfb99d
commit
4d41f82794
1 changed files with 5 additions and 10 deletions
|
@ -43,16 +43,11 @@ class LitterRobotConfigFlow(ConfigFlow, domain=DOMAIN):
|
||||||
"""Handle user's reauth credentials."""
|
"""Handle user's reauth credentials."""
|
||||||
errors = {}
|
errors = {}
|
||||||
if user_input:
|
if user_input:
|
||||||
entry_id = self.context["entry_id"]
|
user_input = user_input | {CONF_USERNAME: self.username}
|
||||||
if entry := self.hass.config_entries.async_get_entry(entry_id):
|
if not (error := await self._async_validate_input(user_input)):
|
||||||
user_input = user_input | {CONF_USERNAME: self.username}
|
return self.async_update_reload_and_abort(
|
||||||
if not (error := await self._async_validate_input(user_input)):
|
self._get_reauth_entry(), data_updates=user_input
|
||||||
self.hass.config_entries.async_update_entry(
|
)
|
||||||
entry,
|
|
||||||
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(
|
||||||
|
|
Loading…
Add table
Reference in a new issue