Skip to content

Commit

Permalink
Improve config flow type hints in wolflink (#125313)
Browse files Browse the repository at this point in the history
  • Loading branch information
epenet authored Sep 13, 2024
1 parent ba856da commit 58f66e5
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions homeassistant/components/wolflink/config_flow.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""Config flow for Wolf SmartSet Service integration."""

import logging
from typing import Any

from httpcore import ConnectError
import voluptuous as vol
from wolf_comm.models import Device
from wolf_comm.token_auth import InvalidAuth
from wolf_comm.wolf_client import WolfClient

Expand All @@ -26,14 +26,15 @@ class WolfLinkConfigFlow(ConfigFlow, domain=DOMAIN):
VERSION = 1
MINOR_VERSION = 2

fetched_systems: list[Device]

def __init__(self) -> None:
"""Initialize with empty username and password."""
self.username = None
self.password = None
self.fetched_systems = None
self.username: str | None = None
self.password: str | None = None

async def async_step_user(
self, user_input: dict[str, Any] | None = None
self, user_input: dict[str, str] | None = None
) -> ConfigFlowResult:
"""Handle the initial step to get connection parameters."""
errors = {}
Expand All @@ -58,9 +59,11 @@ async def async_step_user(
step_id="user", data_schema=USER_SCHEMA, errors=errors
)

async def async_step_device(self, user_input=None):
async def async_step_device(
self, user_input: dict[str, str] | None = None
) -> ConfigFlowResult:
"""Allow user to select device from devices connected to specified account."""
errors = {}
errors: dict[str, str] = {}
if user_input is not None:
device_name = user_input[DEVICE_NAME]
system = [
Expand Down

0 comments on commit 58f66e5

Please sign in to comment.