mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Use new reauth helpers in tankerkoenig (#128756)
This commit is contained in:
parent
ce8893ef6b
commit
3c50b00a9a
@ -144,9 +144,8 @@ class FlowHandler(ConfigFlow, domain=DOMAIN):
|
||||
if not user_input:
|
||||
return self._show_form_reauth()
|
||||
|
||||
entry = self.hass.config_entries.async_get_entry(self.context["entry_id"])
|
||||
assert entry
|
||||
user_input = {**entry.data, **user_input}
|
||||
reauth_entry = self._get_reauth_entry()
|
||||
user_input = {**reauth_entry.data, **user_input}
|
||||
|
||||
tankerkoenig = Tankerkoenig(
|
||||
api_key=user_input[CONF_API_KEY],
|
||||
@ -157,9 +156,7 @@ class FlowHandler(ConfigFlow, domain=DOMAIN):
|
||||
except TankerkoenigInvalidKeyError:
|
||||
return self._show_form_reauth(user_input, {CONF_API_KEY: "invalid_auth"})
|
||||
|
||||
self.hass.config_entries.async_update_entry(entry, data=user_input)
|
||||
await self.hass.config_entries.async_reload(entry.entry_id)
|
||||
return self.async_abort(reason="reauth_successful")
|
||||
return self.async_update_reload_and_abort(reauth_entry, data=user_input)
|
||||
|
||||
def _show_form_user(
|
||||
self,
|
||||
|
Loading…
x
Reference in New Issue
Block a user