mesh map api now gives upstream node

This commit is contained in:
Laura Klünder 2024-03-30 19:32:50 +01:00
parent 740b896d18
commit e9b8d1b645

View file

@ -291,16 +291,16 @@ def mesh_map(request, level_id: int):
} }
}) })
if node_uplink: if node_uplink and node.upstream_id:
uplink_node = nodes[node_uplink.node_id] upstream_node = nodes[node.upstream_id]
if uplink_node.ranging_beacon: if upstream_node.ranging_beacon:
mesh_connection_result.append({ mesh_connection_result.append({
"type": "Feature", "type": "Feature",
"geometry": mapping(LineString( "geometry": mapping(LineString(
list(beacon.geometry.coords) + list(uplink_node.ranging_beacon.geometry.coords) list(beacon.geometry.coords) + list(upstream_node.ranging_beacon.geometry.coords)
)), )),
"properties": { "properties": {
"ap": uplink_node.address, "ap": upstream_node.address,
"sta": node.address, "sta": node.address,
} }
}) })