diff --git a/.strict-typing b/.strict-typing index cd43c375439..ef090d3ab4d 100644 --- a/.strict-typing +++ b/.strict-typing @@ -149,6 +149,7 @@ homeassistant.components.dsmr.* homeassistant.components.dunehd.* homeassistant.components.duotecno.* homeassistant.components.easyenergy.* +homeassistant.components.ecowitt.* homeassistant.components.efergy.* homeassistant.components.electrasmart.* homeassistant.components.electric_kiwi.* diff --git a/homeassistant/components/ecowitt/__init__.py b/homeassistant/components/ecowitt/__init__.py index 567e21b4d87..eaf2441ffac 100644 --- a/homeassistant/components/ecowitt/__init__.py +++ b/homeassistant/components/ecowitt/__init__.py @@ -31,7 +31,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: ) @callback - def _stop_ecowitt(_: Event): + def _stop_ecowitt(_: Event) -> None: """Stop the Ecowitt listener.""" webhook.async_unregister(hass, entry.data[CONF_WEBHOOK_ID]) diff --git a/homeassistant/components/ecowitt/entity.py b/homeassistant/components/ecowitt/entity.py index 12fcca449c0..a5d769e6749 100644 --- a/homeassistant/components/ecowitt/entity.py +++ b/homeassistant/components/ecowitt/entity.py @@ -31,15 +31,15 @@ class EcowittEntity(Entity): sw_version=sensor.station.version, ) - async def async_added_to_hass(self): + async def async_added_to_hass(self) -> None: """Install listener for updates later.""" - def _update_state(): + def _update_state() -> None: """Update the state on callback.""" self.async_write_ha_state() - self.ecowitt.update_cb.append(_update_state) - self.async_on_remove(lambda: self.ecowitt.update_cb.remove(_update_state)) + self.ecowitt.update_cb.append(_update_state) # type: ignore[arg-type] # upstream bug + self.async_on_remove(lambda: self.ecowitt.update_cb.remove(_update_state)) # type: ignore[arg-type] # upstream bug @property def available(self) -> bool: diff --git a/mypy.ini b/mypy.ini index 361bdd63047..8c0d6823efd 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1251,6 +1251,16 @@ disallow_untyped_defs = true warn_return_any = true warn_unreachable = true +[mypy-homeassistant.components.ecowitt.*] +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.efergy.*] check_untyped_defs = true disallow_incomplete_defs = true