From ce77ac609c970bb4545bb32314af7293d29ce327 Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Sun, 11 Oct 2020 00:04:33 -0400 Subject: [PATCH 1/2] fix pylint error --- custom_components/pyscript/config_flow.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/custom_components/pyscript/config_flow.py b/custom_components/pyscript/config_flow.py index d91b636..178de35 100644 --- a/custom_components/pyscript/config_flow.py +++ b/custom_components/pyscript/config_flow.py @@ -1,4 +1,6 @@ """Config flow for pyscript.""" +from typing import Any, Dict, Optional + import voluptuous as vol from homeassistant import config_entries @@ -16,7 +18,7 @@ class PyscriptConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): VERSION = 1 CONNECTION_CLASS = config_entries.CONN_CLASS_LOCAL_PUSH - async def async_step_user(self, user_input): + async def async_step_user(self, user_input: Optional[Dict[str, Any]] = None) -> None: """Handle a flow initialized by the user.""" if user_input is not None: if len(self.hass.config_entries.async_entries(DOMAIN)) > 0: @@ -27,7 +29,7 @@ async def async_step_user(self, user_input): return self.async_show_form(step_id="user", data_schema=PYSCRIPT_SCHEMA) - async def async_step_import(self, import_config): + async def async_step_import(self, import_config: Optional[Dict[str, Any]] = None) -> None: """Import a config entry from configuration.yaml.""" # Check if import config entry matches any existing config entries # so we can update it if necessary From 9f76f18bb1a1418f5dd8e11b13e2d6ded1103483 Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Sun, 11 Oct 2020 00:07:02 -0400 Subject: [PATCH 2/2] remove Optional since it is not necessary --- custom_components/pyscript/config_flow.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/pyscript/config_flow.py b/custom_components/pyscript/config_flow.py index 178de35..fbe113e 100644 --- a/custom_components/pyscript/config_flow.py +++ b/custom_components/pyscript/config_flow.py @@ -1,5 +1,5 @@ """Config flow for pyscript.""" -from typing import Any, Dict, Optional +from typing import Any, Dict import voluptuous as vol @@ -18,7 +18,7 @@ class PyscriptConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): VERSION = 1 CONNECTION_CLASS = config_entries.CONN_CLASS_LOCAL_PUSH - async def async_step_user(self, user_input: Optional[Dict[str, Any]] = None) -> None: + async def async_step_user(self, user_input: Dict[str, Any] = None) -> None: """Handle a flow initialized by the user.""" if user_input is not None: if len(self.hass.config_entries.async_entries(DOMAIN)) > 0: @@ -29,7 +29,7 @@ async def async_step_user(self, user_input: Optional[Dict[str, Any]] = None) -> return self.async_show_form(step_id="user", data_schema=PYSCRIPT_SCHEMA) - async def async_step_import(self, import_config: Optional[Dict[str, Any]] = None) -> None: + async def async_step_import(self, import_config: Dict[str, Any] = None) -> None: """Import a config entry from configuration.yaml.""" # Check if import config entry matches any existing config entries # so we can update it if necessary