Add strict typing to husqvarna automower (#115374)

This commit is contained in:
Thomas55555 2024-04-25 22:39:42 +02:00 committed by GitHub
parent 421dbe1356
commit ccc2f6c5b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 1 deletions

View File

@ -235,6 +235,7 @@ homeassistant.components.homeworks.*
homeassistant.components.http.*
homeassistant.components.huawei_lte.*
homeassistant.components.humidifier.*
homeassistant.components.husqvarna_automower.*
homeassistant.components.hydrawise.*
homeassistant.components.hyperion.*
homeassistant.components.ibeacon.*

View File

@ -1,6 +1,7 @@
"""API for Husqvarna Automower bound to Home Assistant OAuth."""
import logging
from typing import cast
from aioautomower.auth import AbstractAuth
from aioautomower.const import API_BASE_URL
@ -26,4 +27,4 @@ class AsyncConfigEntryAuth(AbstractAuth):
async def async_get_access_token(self) -> str:
"""Return a valid access token."""
await self._oauth_session.async_ensure_token_valid()
return self._oauth_session.token["access_token"]
return cast(str, self._oauth_session.token["access_token"])

View File

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