mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Improve tradfri decorator typing (#75439)
This commit is contained in:
parent
25b874a609
commit
b6d235c0c2
@ -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…
x
Reference in New Issue
Block a user