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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,7 +2,7 @@
from __future__ import annotations
from abc import abstractmethod
from collections.abc import Callable
from collections.abc import Callable, Coroutine
from functools import wraps
from typing import Any, cast
@ -20,7 +20,7 @@ from .coordinator import TradfriDeviceDataUpdateCoordinator
def handle_error(
func: Callable[[Command | list[Command]], Any]
) -> Callable[[str], Any]:
) -> Callable[[Command | list[Command]], Coroutine[Any, Any, None]]:
"""Handle tradfri api call error."""
@wraps(func)