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

Use new config entry update/abort helper in samsungtv #108683

Merged
merged 1 commit into from
Jan 22, 2024
Merged
Changes from all commits
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
11 changes: 4 additions & 7 deletions homeassistant/components/samsungtv/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,11 +528,10 @@ async def async_step_reauth_confirm(
if result == RESULT_SUCCESS:
new_data = dict(self._reauth_entry.data)
new_data[CONF_TOKEN] = bridge.token
self.hass.config_entries.async_update_entry(
self._reauth_entry, data=new_data
return self.async_update_reload_and_abort(
self._reauth_entry,
data=new_data,
)
await self.hass.config_entries.async_reload(self._reauth_entry.entry_id)
return self.async_abort(reason="reauth_successful")
if result not in (RESULT_AUTH_MISSING, RESULT_CANNOT_CONNECT):
return self.async_abort(reason=result)

Expand Down Expand Up @@ -569,16 +568,14 @@ async def async_step_reauth_confirm_encrypted(
and (token := await self._authenticator.try_pin(pin))
and (session_id := await self._authenticator.get_session_id_and_close())
):
self.hass.config_entries.async_update_entry(
return self.async_update_reload_and_abort(
self._reauth_entry,
data={
**self._reauth_entry.data,
CONF_TOKEN: token,
CONF_SESSION_ID: session_id,
},
)
await self.hass.config_entries.async_reload(self._reauth_entry.entry_id)
return self.async_abort(reason="reauth_successful")

errors = {"base": RESULT_INVALID_PIN}

Expand Down