mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 19:09:32 +00:00
Add script specific error messages for response_variable (#95188)
This commit is contained in:
@@ -1753,6 +1753,17 @@ class ServiceRegistry:
|
||||
"""
|
||||
return service.lower() in self._services.get(domain.lower(), [])
|
||||
|
||||
def supports_response(self, domain: str, service: str) -> SupportsResponse:
|
||||
"""Return whether or not the service supports response data.
|
||||
|
||||
This exists so that callers can return more helpful error messages given
|
||||
the context. Will return NONE if the service does not exist as there is
|
||||
other error handling when calling the service if it does not exist.
|
||||
"""
|
||||
if not (handler := self._services[domain][service]):
|
||||
return SupportsResponse.NONE
|
||||
return handler.supports_response
|
||||
|
||||
def register(
|
||||
self,
|
||||
domain: str,
|
||||
|
||||
Reference in New Issue
Block a user