mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Add strict typing to husqvarna automower (#115374)
This commit is contained in:
parent
421dbe1356
commit
ccc2f6c5b5
@ -235,6 +235,7 @@ homeassistant.components.homeworks.*
|
|||||||
homeassistant.components.http.*
|
homeassistant.components.http.*
|
||||||
homeassistant.components.huawei_lte.*
|
homeassistant.components.huawei_lte.*
|
||||||
homeassistant.components.humidifier.*
|
homeassistant.components.humidifier.*
|
||||||
|
homeassistant.components.husqvarna_automower.*
|
||||||
homeassistant.components.hydrawise.*
|
homeassistant.components.hydrawise.*
|
||||||
homeassistant.components.hyperion.*
|
homeassistant.components.hyperion.*
|
||||||
homeassistant.components.ibeacon.*
|
homeassistant.components.ibeacon.*
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
"""API for Husqvarna Automower bound to Home Assistant OAuth."""
|
"""API for Husqvarna Automower bound to Home Assistant OAuth."""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
from typing import cast
|
||||||
|
|
||||||
from aioautomower.auth import AbstractAuth
|
from aioautomower.auth import AbstractAuth
|
||||||
from aioautomower.const import API_BASE_URL
|
from aioautomower.const import API_BASE_URL
|
||||||
@ -26,4 +27,4 @@ class AsyncConfigEntryAuth(AbstractAuth):
|
|||||||
async def async_get_access_token(self) -> str:
|
async def async_get_access_token(self) -> str:
|
||||||
"""Return a valid access token."""
|
"""Return a valid access token."""
|
||||||
await self._oauth_session.async_ensure_token_valid()
|
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_return_any = true
|
||||||
warn_unreachable = 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.*]
|
[mypy-homeassistant.components.hydrawise.*]
|
||||||
check_untyped_defs = true
|
check_untyped_defs = true
|
||||||
disallow_incomplete_defs = true
|
disallow_incomplete_defs = true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user