From 04667649d4f101942291759a51ac93f4e0f0be94 Mon Sep 17 00:00:00 2001 From: Andrew Grimberg Date: Wed, 9 Nov 2022 06:42:01 -0800 Subject: [PATCH] Refactor: Cleanup mypy errors Implicit Optional is no longer valid as of PEP 484 and mypy has now defaulted to no_implicit_optional=True. Signed-off-by: Andrew Grimberg --- custom_components/rental_control/config_flow.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/custom_components/rental_control/config_flow.py b/custom_components/rental_control/config_flow.py index 0bd5dba..5c1059a 100644 --- a/custom_components/rental_control/config_flow.py +++ b/custom_components/rental_control/config_flow.py @@ -116,7 +116,7 @@ def __init__(self, config_entry: config_entries.ConfigEntry): async def async_step_init( self, - user_input: Dict[str, Any] = None, + user_input: Optional[Dict[str, Any]] = None, ) -> Any: """Handle a flow initialized by the user.""" return await _start_config_flow( @@ -197,7 +197,7 @@ def _get_schema( hass: HomeAssistant, user_input: Optional[Dict[str, Any]], default_dict: Optional[Dict[str, Any]], - entry_id: str = None, + entry_id: Optional[str] = None, ) -> vol.Schema: """Gets a schema using the default_dict as a backup.""" if user_input is None: @@ -298,8 +298,8 @@ def _show_config_form( user_input: Optional[Dict[str, Any]], errors: Dict[str, str], description_placeholders: Dict[str, str], - defaults: Dict[str, Any] = None, - entry_id: str = None, + defaults: Optional[Dict[str, Any]] = None, + entry_id: Optional[str] = None, ) -> Any: """Show the configuration form to edit data.""" return cls.async_show_form( @@ -315,8 +315,8 @@ async def _start_config_flow( step_id: str, title: str, user_input: Optional[Dict[str, Any]], - defaults: Dict[str, Any] = None, - entry_id: str = None, + defaults: Optional[Dict[str, Any]] = None, + entry_id: Optional[str] = None, ): """Start a config flow.""" errors = {}