Improve tradfri decorator typing (#75439)
This commit is contained in:
parent
25b874a609
commit
b6d235c0c2
1 changed files with 2 additions and 2 deletions
|
@ -2,7 +2,7 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from abc import abstractmethod
|
from abc import abstractmethod
|
||||||
from collections.abc import Callable
|
from collections.abc import Callable, Coroutine
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
from typing import Any, cast
|
from typing import Any, cast
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ from .coordinator import TradfriDeviceDataUpdateCoordinator
|
||||||
|
|
||||||
def handle_error(
|
def handle_error(
|
||||||
func: Callable[[Command | list[Command]], Any]
|
func: Callable[[Command | list[Command]], Any]
|
||||||
) -> Callable[[str], Any]:
|
) -> Callable[[Command | list[Command]], Coroutine[Any, Any, None]]:
|
||||||
"""Handle tradfri api call error."""
|
"""Handle tradfri api call error."""
|
||||||
|
|
||||||
@wraps(func)
|
@wraps(func)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue