mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Adjust type hints in aosmith config_flow (#127160)
This commit is contained in:
parent
5f1470af9f
commit
2659097010
@ -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
|
||||
@ -85,13 +85,14 @@ class AOSmithConfigFlow(ConfigFlow, domain=DOMAIN):
|
||||
) -> 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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user