Skip to content

Commit

Permalink
Add strict typing to speedtestdotnet (home-assistant#84597)
Browse files Browse the repository at this point in the history
  • Loading branch information
engrbm87 authored Dec 27, 2022
1 parent f1466a3 commit 03112bb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions .strict-typing
Original file line number Diff line number Diff line change
Expand Up @@ -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.*
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/speedtestdotnet/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from datetime import timedelta
import logging
from typing import Any
from typing import Any, cast

import speedtest

Expand Down Expand Up @@ -69,7 +69,7 @@ def update_data(self) -> 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."""
Expand Down
10 changes: 10 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 03112bb

Please sign in to comment.