Add Starlink to .strict-typing (#97598)

This commit is contained in:
Jack Boswell 2023-08-02 18:26:50 +12:00 committed by GitHub
parent ac9ec6e402
commit 49b9dd2a4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 2 deletions

View File

@ -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.*

View File

@ -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:

View File

@ -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:

View File

@ -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