Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve config flow type hints in tellduslive #125299

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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