From a55fb1184a4ef9a2a6c3dced9c465205821bb7f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Mon, 4 Mar 2024 13:36:37 +0000 Subject: [PATCH] Fix pylint/mypy on elmax integration (#112211) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit elmax: config_flow: fix mypy/pylint Signed-off-by: Álvaro Fernández Rojas --- homeassistant/components/elmax/config_flow.py | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/homeassistant/components/elmax/config_flow.py b/homeassistant/components/elmax/config_flow.py index da74e7138bd..2e0c91d7785 100644 --- a/homeassistant/components/elmax/config_flow.py +++ b/homeassistant/components/elmax/config_flow.py @@ -13,7 +13,6 @@ import voluptuous as vol from homeassistant.components.zeroconf import ZeroconfServiceInfo from homeassistant.config_entries import ConfigEntry, ConfigFlow, ConfigFlowResult -from homeassistant.data_entry_flow import FlowResult from homeassistant.exceptions import HomeAssistantError from .common import ( @@ -118,13 +117,13 @@ class ElmaxConfigFlow(ConfigFlow, domain=DOMAIN): async def async_step_user( self, user_input: dict[str, Any] | None = None - ) -> FlowResult: + ) -> ConfigFlowResult: """Handle the flow initiated by the user.""" return await self.async_step_choose_mode(user_input=user_input) async def async_step_choose_mode( self, user_input: dict[str, Any] | None = None - ) -> FlowResult: + ) -> ConfigFlowResult: """Handle local vs cloud mode selection step.""" return self.async_show_menu( step_id="choose_mode", @@ -136,7 +135,7 @@ class ElmaxConfigFlow(ConfigFlow, domain=DOMAIN): async def _handle_direct_and_create_entry( self, fallback_step_id: str, schema: vol.Schema - ) -> FlowResult: + ) -> ConfigFlowResult: return await self._test_direct_and_create_entry() async def _test_direct_and_create_entry(self): @@ -202,7 +201,7 @@ class ElmaxConfigFlow(ConfigFlow, domain=DOMAIN): }, ) - async def async_step_direct(self, user_input: dict[str, Any]) -> FlowResult: + async def async_step_direct(self, user_input: dict[str, Any]) -> ConfigFlowResult: """Handle the direct setup step.""" self._selected_mode = CONF_ELMAX_MODE_CLOUD if user_input is None: @@ -236,7 +235,9 @@ class ElmaxConfigFlow(ConfigFlow, domain=DOMAIN): fallback_step_id=CONF_ELMAX_MODE_DIRECT, schema=tmp_schema ) - async def async_step_zeroconf_setup(self, user_input: dict[str, Any]) -> FlowResult: + async def async_step_zeroconf_setup( + self, user_input: dict[str, Any] + ) -> ConfigFlowResult: """Handle the direct setup step triggered via zeroconf.""" if user_input is None: return self.async_show_form( @@ -265,7 +266,7 @@ class ElmaxConfigFlow(ConfigFlow, domain=DOMAIN): async def _check_unique_and_create_entry( self, unique_id: str, title: str, data: Mapping[str, Any] - ) -> FlowResult: + ) -> ConfigFlowResult: # Make sure this is the only Elmax integration for this specific panel id. await self.async_set_unique_id(unique_id) self._abort_if_unique_id_configured() @@ -275,7 +276,7 @@ class ElmaxConfigFlow(ConfigFlow, domain=DOMAIN): data=data, ) - async def async_step_cloud(self, user_input: dict[str, Any]) -> FlowResult: + async def async_step_cloud(self, user_input: dict[str, Any]) -> ConfigFlowResult: """Handle the cloud setup flow.""" self._selected_mode = CONF_ELMAX_MODE_CLOUD @@ -463,7 +464,7 @@ class ElmaxConfigFlow(ConfigFlow, domain=DOMAIN): host: str, https_port: int, http_port: int, - ) -> FlowResult | None: + ) -> ConfigFlowResult | None: # Look for another entry with the same PANEL_ID (local or remote). # If there already is a matching panel, take the change to notify the Coordinator # so that it uses the newly discovered IP address. This mitigates the issues @@ -496,7 +497,7 @@ class ElmaxConfigFlow(ConfigFlow, domain=DOMAIN): async def async_step_zeroconf( self, discovery_info: ZeroconfServiceInfo - ) -> FlowResult: + ) -> ConfigFlowResult: """Handle device found via zeroconf.""" host = discovery_info.host https_port = (