diff options
-rwxr-xr-x | bin/efa-gw | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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) |