Add supports_response to ServiceRegistry.register() (#106164)

Co-authored-by: rikroe <rikroe@users.noreply.github.com>
pull/105955/head
Richard Kroegel 2023-12-27 13:01:20 +01:00 committed by GitHub
parent 0824a1f4a2
commit bd4177edc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -1970,13 +1970,20 @@ class ServiceRegistry:
Coroutine[Any, Any, ServiceResponse] | ServiceResponse | None,
],
schema: vol.Schema | None = None,
supports_response: SupportsResponse = SupportsResponse.NONE,
) -> None:
"""Register a service.
Schema is called to coerce and validate the service data.
"""
run_callback_threadsafe(
self._hass.loop, self.async_register, domain, service, service_func, schema
self._hass.loop,
self.async_register,
domain,
service,
service_func,
schema,
supports_response,
).result()
@callback