From d582b3f058d09832cc6c1f6dc16038407bdf25ab Mon Sep 17 00:00:00 2001 From: freethenation Date: Sat, 14 Oct 2023 13:05:38 -0400 Subject: [PATCH] Passes a few more fields to the command endpoint so the device sending the command can be identified --- api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api.py b/api.py index fc8097a..a981c6d 100644 --- a/api.py +++ b/api.py @@ -782,7 +782,8 @@ async def websocket_endpoint( if msg["cmd"] == "endpoint": if app.command_endpoint is not None: log.debug(f"Sending {msg['data']} to {app.command_endpoint.name}") - resp = app.command_endpoint.send(jsondata=msg["data"], ws=websocket) + data = {"hostname": client.hostname, "platform": client.platform, "mac_addr":client.mac_addr, **msg["data"]} + resp = app.command_endpoint.send(jsondata=data, ws=websocket) if resp is not None: resp = app.command_endpoint.parse_response(resp) log.debug(f"Got response {resp} from endpoint")