Add strict typing to speedtestdotnet (#84597)

This commit is contained in:
Rami Mosleh 2022-12-27 10:19:56 +02:00 committed by GitHub
parent f1466a3b86
commit 03112bbeea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 2 deletions

View file

@ -265,6 +265,7 @@ homeassistant.components.sleepiq.*
homeassistant.components.smhi.*
homeassistant.components.snooz.*
homeassistant.components.sonarr.*
homeassistant.components.speedtestdotnet.*
homeassistant.components.ssdp.*
homeassistant.components.statistics.*
homeassistant.components.steamist.*

View file

@ -2,7 +2,7 @@
from datetime import timedelta
import logging
from typing import Any
from typing import Any, cast
import speedtest
@ -69,7 +69,7 @@ class SpeedTestDataCoordinator(DataUpdateCoordinator[dict[str, Any]]):
)
self.api.download()
self.api.upload()
return self.api.results.dict()
return cast(dict[str, Any], self.api.results.dict())
async def _async_update_data(self) -> dict[str, Any]:
"""Update Speedtest data."""

View file

@ -2404,6 +2404,16 @@ disallow_untyped_defs = true
warn_return_any = true
warn_unreachable = true
[mypy-homeassistant.components.speedtestdotnet.*]
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.ssdp.*]
check_untyped_defs = true
disallow_incomplete_defs = true