Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix surepetcare token update #126385

Merged
merged 2 commits into from
Sep 23, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions homeassistant/components/surepetcare/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ async def async_step_reauth_confirm(
if user_input is not None:
user_input[CONF_USERNAME] = self._username
try:
await validate_input(self.hass, user_input)
info = await validate_input(self.hass, user_input)
except SurePetcareAuthenticationError:
errors["base"] = "invalid_auth"
except SurePetcareError:
Expand All @@ -111,8 +111,11 @@ async def async_step_reauth_confirm(
user_input[CONF_USERNAME].lower()
)
if existing_entry:
await self.hass.config_entries.async_reload(existing_entry.entry_id)
return self.async_abort(reason="reauth_successful")
user_input[CONF_TOKEN] = info[CONF_TOKEN]
return self.async_update_reload_and_abort(
existing_entry,
data=user_input,
)

return self.async_show_form(
step_id="reauth_confirm",
Expand Down