Improve tradfri decorator typing (#75439)

This commit is contained in:
Marc Mueller
2022-07-19 15:21:17 +02:00
committed by GitHub
parent 25b874a609
commit b6d235c0c2

View File

@@ -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)