Use the async_call context in result of call_service (#44458)

This commit is contained in:
Jason Cronquist 2020-12-31 19:15:39 -07:00 committed by GitHub
parent db6bd22fc9
commit 787027958d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -132,15 +132,16 @@ async def handle_call_service(hass, connection, msg):
blocking = False blocking = False
try: try:
context = connection.context(msg)
await hass.services.async_call( await hass.services.async_call(
msg["domain"], msg["domain"],
msg["service"], msg["service"],
msg.get("service_data"), msg.get("service_data"),
blocking, blocking,
connection.context(msg), context,
) )
connection.send_message( connection.send_message(
messages.result_message(msg["id"], {"context": connection.context(msg)}) messages.result_message(msg["id"], {"context": context})
) )
except ServiceNotFound as err: except ServiceNotFound as err:
if err.domain == msg["domain"] and err.service == msg["service"]: if err.domain == msg["domain"] and err.service == msg["service"]: