Add strict typing to husqvarna automower (#115374)
parent
421dbe1356
commit
ccc2f6c5b5
|
@ -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.*
|
||||
|
|
|
@ -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"])
|
||||
|
|
10
mypy.ini
10
mypy.ini
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue