From 043b9c66b0c8ea646b49ef83f0edec92f95a2dfa Mon Sep 17 00:00:00 2001 From: Simon Hansen <67142049+DurgNomis-drol@users.noreply.github.com> Date: Fri, 14 Jan 2022 22:15:38 +0100 Subject: [PATCH] Add missing type annotation for launch library (#64131) * Add missing type annotation in config flow * Add import * Add default None * Fix black * Fix linting --- homeassistant/components/launch_library/config_flow.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/launch_library/config_flow.py b/homeassistant/components/launch_library/config_flow.py index 2cc668c8e35..1023bb84079 100644 --- a/homeassistant/components/launch_library/config_flow.py +++ b/homeassistant/components/launch_library/config_flow.py @@ -1,4 +1,8 @@ """Config flow to configure launch library component.""" +from __future__ import annotations + +from typing import Any + from homeassistant import config_entries from homeassistant.const import CONF_NAME from homeassistant.data_entry_flow import FlowResult @@ -11,7 +15,9 @@ class LaunchLibraryFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): VERSION = 1 - async def async_step_user(self, user_input=None) -> FlowResult: + async def async_step_user( + self, user_input: dict[str, Any] | None = None + ) -> FlowResult: """Handle a flow initialized by the user.""" # Check if already configured if self._async_current_entries(): @@ -22,6 +28,6 @@ class LaunchLibraryFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): return self.async_show_form(step_id="user") - async def async_step_import(self, conf: dict) -> FlowResult: + async def async_step_import(self, conf: dict[str, Any]) -> FlowResult: """Import a configuration from config.yaml.""" return await self.async_step_user(user_input={CONF_NAME: conf[CONF_NAME]})