Fix schema typing (1) (#120443)

This commit is contained in:
Marc Mueller 2024-06-25 18:54:06 +02:00 committed by GitHub
parent f017134199
commit 197062139e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 7 additions and 9 deletions

View File

@ -111,7 +111,7 @@ class ForkedDaapdFlowHandler(ConfigFlow, domain=DOMAIN):
def __init__(self) -> None: def __init__(self) -> None:
"""Initialize.""" """Initialize."""
self.discovery_schema = None self.discovery_schema: vol.Schema | None = None
@staticmethod @staticmethod
@callback @callback

View File

@ -75,9 +75,7 @@ class LinearGarageDoorConfigFlow(ConfigFlow, domain=DOMAIN):
self, user_input: dict[str, Any] | None = None self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult: ) -> ConfigFlowResult:
"""Handle the initial step.""" """Handle the initial step."""
data_schema = STEP_USER_DATA_SCHEMA data_schema = vol.Schema(STEP_USER_DATA_SCHEMA)
data_schema = vol.Schema(data_schema)
if user_input is None: if user_input is None:
return self.async_show_form(step_id="user", data_schema=data_schema) return self.async_show_form(step_id="user", data_schema=data_schema)

View File

@ -75,7 +75,7 @@ class MotionBlindsFlowHandler(ConfigFlow, domain=DOMAIN):
"""Initialize the Motionblinds flow.""" """Initialize the Motionblinds flow."""
self._host: str | None = None self._host: str | None = None
self._ips: list[str] = [] self._ips: list[str] = []
self._config_settings = None self._config_settings: vol.Schema | None = None
@staticmethod @staticmethod
@callback @callback

View File

@ -138,7 +138,7 @@ class SynologyDSMFlowHandler(ConfigFlow, domain=DOMAIN):
user_input = {} user_input = {}
description_placeholders = {} description_placeholders = {}
data_schema = {} data_schema = None
if step_id == "link": if step_id == "link":
user_input.update(self.discovered_conf) user_input.update(self.discovered_conf)

View File

@ -188,7 +188,7 @@ class VizioConfigFlow(ConfigFlow, domain=DOMAIN):
def __init__(self) -> None: def __init__(self) -> None:
"""Initialize config flow.""" """Initialize config flow."""
self._user_schema = None self._user_schema: vol.Schema | None = None
self._must_show_form: bool | None = None self._must_show_form: bool | None = None
self._ch_type: str | None = None self._ch_type: str | None = None
self._pairing_token: str | None = None self._pairing_token: str | None = None

View File

@ -221,7 +221,7 @@ class BaseZhaFlow(ConfigEntryBaseFlow):
return await self.async_step_verify_radio() return await self.async_step_verify_radio()
# Pre-select the currently configured port # Pre-select the currently configured port
default_port = vol.UNDEFINED default_port: vol.Undefined | str = vol.UNDEFINED
if self._radio_mgr.device_path is not None: if self._radio_mgr.device_path is not None:
for description, port in zip(list_of_ports, ports, strict=False): for description, port in zip(list_of_ports, ports, strict=False):
@ -251,7 +251,7 @@ class BaseZhaFlow(ConfigEntryBaseFlow):
return await self.async_step_manual_port_config() return await self.async_step_manual_port_config()
# Pre-select the current radio type # Pre-select the current radio type
default = vol.UNDEFINED default: vol.Undefined | str = vol.UNDEFINED
if self._radio_mgr.radio_type is not None: if self._radio_mgr.radio_type is not None:
default = self._radio_mgr.radio_type.description default = self._radio_mgr.radio_type.description