diff --git a/homeassistant/core.py b/homeassistant/core.py index 3e29452bff0..9edd7f8cbca 100644 --- a/homeassistant/core.py +++ b/homeassistant/core.py @@ -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)