From 49b9dd2a4fa7813d9368e3f8f9e462e75a3f9663 Mon Sep 17 00:00:00 2001 From: Jack Boswell Date: Wed, 2 Aug 2023 18:26:50 +1200 Subject: [PATCH] Add Starlink to .strict-typing (#97598) --- .strict-typing | 1 + homeassistant/components/starlink/config_flow.py | 1 + homeassistant/components/starlink/coordinator.py | 4 ++-- mypy.ini | 10 ++++++++++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.strict-typing b/.strict-typing index dffeb08e014..eec8bd906fe 100644 --- a/.strict-typing +++ b/.strict-typing @@ -296,6 +296,7 @@ homeassistant.components.sonarr.* homeassistant.components.speedtestdotnet.* homeassistant.components.sql.* homeassistant.components.ssdp.* +homeassistant.components.starlink.* homeassistant.components.statistics.* homeassistant.components.steamist.* homeassistant.components.stookalert.* diff --git a/homeassistant/components/starlink/config_flow.py b/homeassistant/components/starlink/config_flow.py index 4154ef09adf..987a84796f1 100644 --- a/homeassistant/components/starlink/config_flow.py +++ b/homeassistant/components/starlink/config_flow.py @@ -44,6 +44,7 @@ class StarlinkConfigFlow(ConfigFlow, domain=DOMAIN): async def get_device_id(self, url: str) -> str | None: """Get the device UID, or None if no device exists at the given URL.""" context = ChannelContext(target=url) + response: str | None try: response = await self.hass.async_add_executor_job(get_id, context) except GrpcError: diff --git a/homeassistant/components/starlink/coordinator.py b/homeassistant/components/starlink/coordinator.py index 56d25bf2d1a..f6f3623f8d4 100644 --- a/homeassistant/components/starlink/coordinator.py +++ b/homeassistant/components/starlink/coordinator.py @@ -57,7 +57,7 @@ class StarlinkUpdateCoordinator(DataUpdateCoordinator[StarlinkData]): except GrpcError as exc: raise UpdateFailed from exc - async def async_stow_starlink(self, stow: bool): + async def async_stow_starlink(self, stow: bool) -> None: """Set whether Starlink system tied to this coordinator should be stowed.""" async with async_timeout.timeout(4): try: @@ -67,7 +67,7 @@ class StarlinkUpdateCoordinator(DataUpdateCoordinator[StarlinkData]): except GrpcError as exc: raise HomeAssistantError from exc - async def async_reboot_starlink(self): + async def async_reboot_starlink(self) -> None: """Reboot the Starlink system tied to this coordinator.""" async with async_timeout.timeout(4): try: diff --git a/mypy.ini b/mypy.ini index 7d1ec19c4d5..639f27bbabb 100644 --- a/mypy.ini +++ b/mypy.ini @@ -2722,6 +2722,16 @@ disallow_untyped_defs = true warn_return_any = true warn_unreachable = true +[mypy-homeassistant.components.starlink.*] +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.statistics.*] check_untyped_defs = true disallow_incomplete_defs = true