From b9df4c4e63c0bf5c2f761386d8a7e7b3285b8a71 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 27 Mar 2021 15:01:29 +0100 Subject: move train data to sub-dict in case of future expansions --- bin/efa-gw | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/efa-gw b/bin/efa-gw index 4d92e2c..d56604c 100755 --- a/bin/efa-gw +++ b/bin/efa-gw @@ -42,14 +42,16 @@ async def handle_eva(request): ) as response: content = await response.text() content = json.loads(content) - reply = dict() + train_data = dict() for train in content["raw"]: if train["train_no"]: - reply[train["train_no"]] = { + train_data[train["train_no"]] = { "occupancy": get_occupancy(train["occupancy"]) } + reply = {"train": train_data} + return web.Response(body=json.dumps(reply), headers=headers) -- cgit v1.2.3