From 0dc61b34930f6fdafa3532050987431a3d317b69 Mon Sep 17 00:00:00 2001 From: Erwin Douna Date: Mon, 11 Dec 2023 20:30:19 +0100 Subject: [PATCH] Add typing in Melcloud config flow (#105510) * Add typing in config flow * Patching functions with typing --- homeassistant/components/melcloud/config_flow.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/melcloud/config_flow.py b/homeassistant/components/melcloud/config_flow.py index b19e268a4c3..9293c9bb3d5 100644 --- a/homeassistant/components/melcloud/config_flow.py +++ b/homeassistant/components/melcloud/config_flow.py @@ -63,7 +63,7 @@ class FlowHandler(config_entries.ConfigFlow, domain=DOMAIN): entry: config_entries.ConfigEntry | None = None - async def _create_entry(self, username: str, token: str): + async def _create_entry(self, username: str, token: str) -> FlowResult: """Register new entry.""" await self.async_set_unique_id(username) try: @@ -81,7 +81,7 @@ class FlowHandler(config_entries.ConfigFlow, domain=DOMAIN): *, password: str | None = None, token: str | None = None, - ): + ) -> FlowResult: """Create client.""" try: async with asyncio.timeout(10): @@ -113,7 +113,9 @@ class FlowHandler(config_entries.ConfigFlow, domain=DOMAIN): return await self._create_entry(username, acquired_token) - async def async_step_user(self, user_input=None): + async def async_step_user( + self, user_input: dict[str, Any] | None = None + ) -> FlowResult: """User initiated config flow.""" if user_input is None: return self.async_show_form( @@ -125,7 +127,7 @@ class FlowHandler(config_entries.ConfigFlow, domain=DOMAIN): username = user_input[CONF_USERNAME] return await self._create_client(username, password=user_input[CONF_PASSWORD]) - async def async_step_import(self, user_input): + async def async_step_import(self, user_input: dict[str, Any]) -> FlowResult: """Import a config entry.""" result = await self._create_client( user_input[CONF_USERNAME], token=user_input[CONF_TOKEN]