Replace meaningless TypeVar usage (#117553)

This commit is contained in:
Marc Mueller 2024-05-16 12:48:02 +02:00 committed by GitHub
parent ab07bc5298
commit 53da59a454
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2766,14 +2766,16 @@ class ServiceRegistry:
target = job.target
if job.job_type is HassJobType.Coroutinefunction:
if TYPE_CHECKING:
target = cast(Callable[..., Coroutine[Any, Any, _R]], target)
target = cast(
Callable[..., Coroutine[Any, Any, ServiceResponse]], target
)
return await target(service_call)
if job.job_type is HassJobType.Callback:
if TYPE_CHECKING:
target = cast(Callable[..., _R], target)
target = cast(Callable[..., ServiceResponse], target)
return target(service_call)
if TYPE_CHECKING:
target = cast(Callable[..., _R], target)
target = cast(Callable[..., ServiceResponse], target)
return await self._hass.async_add_executor_job(target, service_call)