Skip to content

Commit

Permalink
Improve config flow type hints in tellduslive (#125299)
Browse files Browse the repository at this point in the history
  • Loading branch information
epenet authored Sep 6, 2024
1 parent 86ef7ba commit 3a5309e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions homeassistant/components/tellduslive/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,15 @@ class FlowHandler(ConfigFlow, domain=DOMAIN):

VERSION = 1

_session: Session

def __init__(self) -> None:
"""Init config flow."""
self._hosts = [CLOUD_NAME]
self._host = None
self._session = None
self._scan_interval = SCAN_INTERVAL

def _get_auth_url(self):
def _get_auth_url(self) -> str | None:
self._session = Session(
public_key=PUBLIC_KEY,
private_key=NOT_SO_PRIVATE_KEY,
Expand Down Expand Up @@ -70,7 +71,9 @@ async def async_step_user(
),
)

async def async_step_auth(self, user_input=None):
async def async_step_auth(
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
"""Handle the submitted configuration."""
errors = {}
if user_input is not None:
Expand Down Expand Up @@ -114,7 +117,10 @@ async def async_step_auth(self, user_input=None):
},
)

async def async_step_discovery(self, discovery_info):
async def async_step_discovery(
self,
discovery_info: list[str], # type: ignore[override]
) -> ConfigFlowResult:
"""Run when a Tellstick is discovered."""
await self._async_handle_discovery_without_unique_id()

Expand Down

0 comments on commit 3a5309e

Please sign in to comment.