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"