summaryrefslogtreecommitdiff
path: root/bin/efa-gw
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-03-27 15:01:29 +0100
committerDaniel Friesel <derf@finalrewind.org>2021-03-27 15:01:29 +0100
commitb9df4c4e63c0bf5c2f761386d8a7e7b3285b8a71 (patch)
tree33a42ad4bb33b92519cfab37a735f57e6d1f206d /bin/efa-gw
parent08ba0611c2c6a0e022a9fd0aff6399c7b957a9e7 (diff)
move train data to sub-dict in case of future expansions
Diffstat (limited to 'bin/efa-gw')
-rwxr-xr-xbin/efa-gw6
1 files changed, 4 insertions, 2 deletions
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)