Add missing type annotation for launch library (#64131)
* Add missing type annotation in config flow * Add import * Add default None * Fix black * Fix linting
This commit is contained in:
parent
fede0f8e66
commit
043b9c66b0
1 changed files with 8 additions and 2 deletions
|
@ -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]})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue