mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 16:57:10 +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,
|
||||
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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user