Skip to content

Commit

Permalink
Adjust type hints in aosmith config_flow (home-assistant#127160)
Browse files Browse the repository at this point in the history
  • Loading branch information
epenet authored Oct 1, 2024
1 parent 5f1470a commit 2659097
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions homeassistant/components/aosmith/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class AOSmithConfigFlow(ConfigFlow, domain=DOMAIN):

VERSION = 1

_reauth_email: str | None = None
_reauth_email: str

async def _async_validate_credentials(
self, email: str, password: str
Expand Down Expand Up @@ -85,13 +85,14 @@ async def async_step_reauth_confirm(
) -> ConfigFlowResult:
"""Handle user's reauth credentials."""
errors: dict[str, str] = {}
if user_input is not None and self._reauth_email is not None:
email = self._reauth_email
if user_input:
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_credentials(email, password)
error = await self._async_validate_credentials(
self._reauth_email, password
)
if error is None:
self.hass.config_entries.async_update_entry(
entry,
Expand Down

0 comments on commit 2659097

Please sign in to comment.