From 787027958d17fb095d1347e46c057e8d62ec3586 Mon Sep 17 00:00:00 2001 From: Jason Cronquist Date: Thu, 31 Dec 2020 19:15:39 -0700 Subject: [PATCH] Use the async_call context in result of call_service (#44458) --- homeassistant/components/websocket_api/commands.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/websocket_api/commands.py b/homeassistant/components/websocket_api/commands.py index 80ea945834b..fb9ffea2904 100644 --- a/homeassistant/components/websocket_api/commands.py +++ b/homeassistant/components/websocket_api/commands.py @@ -132,15 +132,16 @@ async def handle_call_service(hass, connection, msg): blocking = False try: + context = connection.context(msg) await hass.services.async_call( msg["domain"], msg["service"], msg.get("service_data"), blocking, - connection.context(msg), + context, ) connection.send_message( - messages.result_message(msg["id"], {"context": connection.context(msg)}) + messages.result_message(msg["id"], {"context": context}) ) except ServiceNotFound as err: if err.domain == msg["domain"] and err.service == msg["service"]: