mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 01:37:08 +00:00
Add type annotation for service functions with response (#102813)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
4bbdf475b4
commit
9af5e838c6
@ -1773,7 +1773,10 @@ class Service:
|
|||||||
self,
|
self,
|
||||||
func: Callable[
|
func: Callable[
|
||||||
[ServiceCall],
|
[ServiceCall],
|
||||||
Coroutine[Any, Any, ServiceResponse | EntityServiceResponse] | None,
|
Coroutine[Any, Any, ServiceResponse | EntityServiceResponse]
|
||||||
|
| ServiceResponse
|
||||||
|
| EntityServiceResponse
|
||||||
|
| None,
|
||||||
],
|
],
|
||||||
schema: vol.Schema | None,
|
schema: vol.Schema | None,
|
||||||
domain: str,
|
domain: str,
|
||||||
@ -1865,7 +1868,7 @@ class ServiceRegistry:
|
|||||||
service: str,
|
service: str,
|
||||||
service_func: Callable[
|
service_func: Callable[
|
||||||
[ServiceCall],
|
[ServiceCall],
|
||||||
Coroutine[Any, Any, ServiceResponse] | None,
|
Coroutine[Any, Any, ServiceResponse] | ServiceResponse | None,
|
||||||
],
|
],
|
||||||
schema: vol.Schema | None = None,
|
schema: vol.Schema | None = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
@ -1884,7 +1887,10 @@ class ServiceRegistry:
|
|||||||
service: str,
|
service: str,
|
||||||
service_func: Callable[
|
service_func: Callable[
|
||||||
[ServiceCall],
|
[ServiceCall],
|
||||||
Coroutine[Any, Any, ServiceResponse | EntityServiceResponse] | None,
|
Coroutine[Any, Any, ServiceResponse | EntityServiceResponse]
|
||||||
|
| ServiceResponse
|
||||||
|
| EntityServiceResponse
|
||||||
|
| None,
|
||||||
],
|
],
|
||||||
schema: vol.Schema | None = None,
|
schema: vol.Schema | None = None,
|
||||||
supports_response: SupportsResponse = SupportsResponse.NONE,
|
supports_response: SupportsResponse = SupportsResponse.NONE,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user