Add strict typing to speedtestdotnet (#84597)
This commit is contained in:
parent
f1466a3b86
commit
03112bbeea
3 changed files with 13 additions and 2 deletions
|
@ -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.*
|
||||
|
|
|
@ -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."""
|
||||
|
|
10
mypy.ini
10
mypy.ini
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue