From 283ff4fadaaf5e46737f29841573922a3ff41940 Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Tue, 12 Dec 2023 21:29:18 +0100 Subject: [PATCH] Add Adax to strict typing (#105562) --- .strict-typing | 1 + homeassistant/components/adax/__init__.py | 2 +- homeassistant/components/adax/climate.py | 2 +- homeassistant/components/adax/config_flow.py | 8 ++++++-- mypy.ini | 10 ++++++++++ 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.strict-typing b/.strict-typing index e2a630f0179..4ee01b15d1a 100644 --- a/.strict-typing +++ b/.strict-typing @@ -43,6 +43,7 @@ homeassistant.components.abode.* homeassistant.components.accuweather.* homeassistant.components.acer_projector.* homeassistant.components.actiontec.* +homeassistant.components.adax.* homeassistant.components.adguard.* homeassistant.components.aftership.* homeassistant.components.air_quality.* diff --git a/homeassistant/components/adax/__init__.py b/homeassistant/components/adax/__init__.py index 511fb746216..cf60d40631c 100644 --- a/homeassistant/components/adax/__init__.py +++ b/homeassistant/components/adax/__init__.py @@ -24,7 +24,7 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> # convert title and unique_id to string if config_entry.version == 1: if isinstance(config_entry.unique_id, int): - hass.config_entries.async_update_entry( + hass.config_entries.async_update_entry( # type: ignore[unreachable] config_entry, unique_id=str(config_entry.unique_id), title=str(config_entry.title), diff --git a/homeassistant/components/adax/climate.py b/homeassistant/components/adax/climate.py index 7587bfc0799..34812f9e449 100644 --- a/homeassistant/components/adax/climate.py +++ b/homeassistant/components/adax/climate.py @@ -137,7 +137,7 @@ class LocalAdaxDevice(ClimateEntity): _attr_target_temperature_step = PRECISION_WHOLE _attr_temperature_unit = UnitOfTemperature.CELSIUS - def __init__(self, adax_data_handler, unique_id): + def __init__(self, adax_data_handler: AdaxLocal, unique_id: str) -> None: """Initialize the heater.""" self._adax_data_handler = adax_data_handler self._attr_unique_id = unique_id diff --git a/homeassistant/components/adax/config_flow.py b/homeassistant/components/adax/config_flow.py index b9e8ef1abca..b614c968d48 100644 --- a/homeassistant/components/adax/config_flow.py +++ b/homeassistant/components/adax/config_flow.py @@ -36,7 +36,9 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): VERSION = 2 - async def async_step_user(self, user_input=None): + async def async_step_user( + self, user_input: dict[str, Any] | None = None + ) -> FlowResult: """Handle the initial step.""" data_schema = vol.Schema( { @@ -59,7 +61,9 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): return await self.async_step_local() return await self.async_step_cloud() - async def async_step_local(self, user_input=None): + async def async_step_local( + self, user_input: dict[str, Any] | None = None + ) -> FlowResult: """Handle the local step.""" data_schema = vol.Schema( {vol.Required(WIFI_SSID): str, vol.Required(WIFI_PSWD): str} diff --git a/mypy.ini b/mypy.ini index 94ff0c1e46d..cf590b53918 100644 --- a/mypy.ini +++ b/mypy.ini @@ -190,6 +190,16 @@ disallow_untyped_defs = true warn_return_any = true warn_unreachable = true +[mypy-homeassistant.components.adax.*] +check_untyped_defs = true +disallow_incomplete_defs = true +disallow_subclassing_any = true +disallow_untyped_calls = true +disallow_untyped_decorators = true +disallow_untyped_defs = true +warn_return_any = true +warn_unreachable = true + [mypy-homeassistant.components.adguard.*] check_untyped_defs = true disallow_incomplete_defs = true