diff --git a/.strict-typing b/.strict-typing index dea3fb25ffd..cceaeb9ee52 100644 --- a/.strict-typing +++ b/.strict-typing @@ -64,6 +64,7 @@ homeassistant.components.amcrest.* homeassistant.components.ampio.* homeassistant.components.analytics.* homeassistant.components.android_ip_webcam.* +homeassistant.components.androidtv.* homeassistant.components.androidtv_remote.* homeassistant.components.anel_pwrctrl.* homeassistant.components.anova.* diff --git a/homeassistant/components/androidtv/__init__.py b/homeassistant/components/androidtv/__init__.py index 4a1ad55e0b1..cd9e42aeb4d 100644 --- a/homeassistant/components/androidtv/__init__.py +++ b/homeassistant/components/androidtv/__init__.py @@ -28,7 +28,7 @@ from homeassistant.const import ( EVENT_HOMEASSISTANT_STOP, Platform, ) -from homeassistant.core import HomeAssistant +from homeassistant.core import Event, HomeAssistant from homeassistant.exceptions import ConfigEntryNotReady from homeassistant.helpers.device_registry import format_mac from homeassistant.helpers.dispatcher import async_dispatcher_send @@ -166,7 +166,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: if not aftv: raise ConfigEntryNotReady(error_message) - async def async_close_connection(event): + async def async_close_connection(event: Event) -> None: """Close Android Debug Bridge connection on HA Stop.""" await aftv.adb_close() diff --git a/homeassistant/components/androidtv/config_flow.py b/homeassistant/components/androidtv/config_flow.py index 7e2b1e85f39..e688b0a92de 100644 --- a/homeassistant/components/androidtv/config_flow.py +++ b/homeassistant/components/androidtv/config_flow.py @@ -385,4 +385,4 @@ def _validate_state_det_rules(state_det_rules: Any) -> list[Any] | None: except ValueError as exc: _LOGGER.warning("Invalid state detection rules: %s", exc) return None - return json_rules + return json_rules # type: ignore[no-any-return] diff --git a/homeassistant/components/androidtv/media_player.py b/homeassistant/components/androidtv/media_player.py index 496b4e51e4f..bd058ac769e 100644 --- a/homeassistant/components/androidtv/media_player.py +++ b/homeassistant/components/androidtv/media_player.py @@ -313,7 +313,7 @@ class ADBDevice(MediaPlayerEntity): @adb_decorator() async def _adb_screencap(self) -> bytes | None: """Take a screen capture from the device.""" - return await self.aftv.adb_screencap() + return await self.aftv.adb_screencap() # type: ignore[no-any-return] async def _async_get_screencap(self, prev_app_id: str | None = None) -> None: """Take a screen capture from the device when enabled.""" @@ -331,7 +331,7 @@ class ADBDevice(MediaPlayerEntity): await self._adb_get_screencap(no_throttle=force) @Throttle(MIN_TIME_BETWEEN_SCREENCAPS) - async def _adb_get_screencap(self, **kwargs) -> None: + async def _adb_get_screencap(self, **kwargs: Any) -> None: """Take a screen capture from the device every 60 seconds.""" if media_data := await self._adb_screencap(): self._media_image = media_data, "image/png" diff --git a/mypy.ini b/mypy.ini index 71a50796866..57020bc9f3a 100644 --- a/mypy.ini +++ b/mypy.ini @@ -400,6 +400,16 @@ disallow_untyped_defs = true warn_return_any = true warn_unreachable = true +[mypy-homeassistant.components.androidtv.*] +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.androidtv_remote.*] check_untyped_defs = true disallow_incomplete_defs = true