diff --git a/.strict-typing b/.strict-typing index 598f2bc1f6d..fcb8552bd8b 100644 --- a/.strict-typing +++ b/.strict-typing @@ -58,6 +58,7 @@ homeassistant.components.amcrest.* homeassistant.components.ampio.* homeassistant.components.analytics.* homeassistant.components.anthemav.* +homeassistant.components.apcupsd.* homeassistant.components.aqualogic.* homeassistant.components.aseko_pool_live.* homeassistant.components.asuswrt.* diff --git a/homeassistant/components/apcupsd/__init__.py b/homeassistant/components/apcupsd/__init__.py index e7088a09101..3fb8bf00b8a 100644 --- a/homeassistant/components/apcupsd/__init__.py +++ b/homeassistant/components/apcupsd/__init__.py @@ -62,7 +62,7 @@ class APCUPSdData: """Initialize the data object.""" self._host = host self._port = port - self.status: dict[str, Any] = {} + self.status: dict[str, str] = {} @property def name(self) -> str | None: @@ -100,7 +100,7 @@ class APCUPSdData: return self.status.get("STATFLAG") @Throttle(MIN_TIME_BETWEEN_UPDATES) - def update(self, **kwargs): + def update(self, **kwargs: Any) -> None: """Fetch the latest status from APCUPSd. Note that the result dict uses upper case for each resource, where our diff --git a/homeassistant/components/apcupsd/sensor.py b/homeassistant/components/apcupsd/sensor.py index 2bc38b1d50c..845e482d12c 100644 --- a/homeassistant/components/apcupsd/sensor.py +++ b/homeassistant/components/apcupsd/sensor.py @@ -465,7 +465,7 @@ async def async_setup_entry( async_add_entities(entities, update_before_add=True) -def infer_unit(value): +def infer_unit(value: str) -> tuple[str, str | None]: """If the value ends with any of the units from ALL_UNITS. Split the unit off the end of the value and return the value, unit tuple diff --git a/mypy.ini b/mypy.ini index 2e0c5d2ae0d..40f523a2811 100644 --- a/mypy.ini +++ b/mypy.ini @@ -333,6 +333,16 @@ disallow_untyped_defs = true warn_return_any = true warn_unreachable = true +[mypy-homeassistant.components.apcupsd.*] +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.aqualogic.*] check_untyped_defs = true disallow_incomplete_defs = true