Add type annotation for service functions with response (#102813)

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
tronikos 2023-11-09 03:31:12 -08:00 committed by GitHub
parent 4bbdf475b4
commit 9af5e838c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1773,7 +1773,10 @@ class Service:
self,
func: Callable[
[ServiceCall],
Coroutine[Any, Any, ServiceResponse | EntityServiceResponse] | None,
Coroutine[Any, Any, ServiceResponse | EntityServiceResponse]
| ServiceResponse
| EntityServiceResponse
| None,
],
schema: vol.Schema | None,
domain: str,
@ -1865,7 +1868,7 @@ class ServiceRegistry:
service: str,
service_func: Callable[
[ServiceCall],
Coroutine[Any, Any, ServiceResponse] | None,
Coroutine[Any, Any, ServiceResponse] | ServiceResponse | None,
],
schema: vol.Schema | None = None,
) -> None:
@ -1884,7 +1887,10 @@ class ServiceRegistry:
service: str,
service_func: Callable[
[ServiceCall],
Coroutine[Any, Any, ServiceResponse | EntityServiceResponse] | None,
Coroutine[Any, Any, ServiceResponse | EntityServiceResponse]
| ServiceResponse
| EntityServiceResponse
| None,
],
schema: vol.Schema | None = None,
supports_response: SupportsResponse = SupportsResponse.NONE,