mirror of
https://github.com/home-assistant/core.git
synced 2025-07-08 13:57:10 +00:00
Improve blink config_flow typing (#99579)
This commit is contained in:
parent
2628a86864
commit
ab3bc1b74b
@ -59,7 +59,7 @@ def validate_input(auth: Auth) -> None:
|
|||||||
raise Require2FA
|
raise Require2FA
|
||||||
|
|
||||||
|
|
||||||
def _send_blink_2fa_pin(auth: Auth, pin: str) -> bool:
|
def _send_blink_2fa_pin(auth: Auth, pin: str | None) -> bool:
|
||||||
"""Send 2FA pin to blink servers."""
|
"""Send 2FA pin to blink servers."""
|
||||||
blink = Blink()
|
blink = Blink()
|
||||||
blink.auth = auth
|
blink.auth = auth
|
||||||
@ -122,8 +122,9 @@ class BlinkConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
"""Handle 2FA step."""
|
"""Handle 2FA step."""
|
||||||
errors = {}
|
errors = {}
|
||||||
if user_input is not None:
|
if user_input is not None:
|
||||||
pin = user_input.get(CONF_PIN)
|
pin: str | None = user_input.get(CONF_PIN)
|
||||||
try:
|
try:
|
||||||
|
assert self.auth
|
||||||
valid_token = await self.hass.async_add_executor_job(
|
valid_token = await self.hass.async_add_executor_job(
|
||||||
_send_blink_2fa_pin, self.auth, pin
|
_send_blink_2fa_pin, self.auth, pin
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user