-
Notifications
You must be signed in to change notification settings - Fork 437
Open
Labels
enhancementNew feature or requestNew feature or request
Description
HA services have three possible states for response: null, optional, not optional. Since the new auto detection mechanism was put in place, there is no way to obtain the response from services that mark the the result state as optional such as the conversation API and process service. Unfortunately this means it's impossible to use AppDaemon to write a middleware for conversations.
appdaemon/appdaemon/plugins/hass/hassplugin.py
Lines 750 to 753 in 929ab84
| # Set the return_response flag if doing so is not optional | |
| match service_properties: | |
| case {"response": {"optional": False}}: | |
| req["return_response"] = True |
See also this issue #2232 and #2010
Additionally this works perfectly fine while calling the parent websocket method:
req = {
"type": "call_service",
"domain": "conversation",
"service": "process",
"service_data": {
"text": "Tell me about something",
},
"return_response": True
}
res = await self._plugin.websocket_send_json(**req)Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request