From dd1314a9de37bfe7ca4023ce11e337b301abb1fd Mon Sep 17 00:00:00 2001 From: iFargle Date: Tue, 28 Mar 2023 21:49:08 +0900 Subject: [PATCH] test --- renderer.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/renderer.py b/renderer.py index 81990b5..7dddbed 100644 --- a/renderer.py +++ b/renderer.py @@ -803,14 +803,15 @@ def render_routes(): # Build the display: for route_id in route_id_list: + idx = int(route_id) - 1 # Get info on every route in the list: route_id-1 is the position in the array starting 0 - machine = all_routes["routes"][int(route_id)-1]["machine"]["givenName"] - machine_id = all_routes["routes"][int(route_id)-1]["machine"]["id"] - is_primary = all_routes["routes"][int(route_id)-1]["isPrimary"] - is_enabled = all_routes["routes"][int(route_id)-1]["enabled"] + machine = all_routes["routes"][idx]["machine"]["givenName"] + machine_id = all_routes["routes"][idx]["machine"]["id"] + is_primary = all_routes["routes"][idx]["isPrimary"] + is_enabled = all_routes["routes"][idx]["enabled"] app.logger.debug("[%s] Machine: [%s] %s : %s / %s", str(route_id), str(machine_id), str(machine), str(is_enabled), str(is_primary)) - app.logger.debug(str(all_routes["routes"][int(route_id)-1])) + app.logger.debug(str(all_routes["routes"][idx])) # Set up the display code: enabled = "fiber_manual_record"