mirror of
https://github.com/pablorevilla-meshtastic/meshview.git
synced 2026-07-05 09:21:07 +02:00
Add a single old location point to the trace if we have one.
This commit is contained in:
@@ -36,6 +36,12 @@ async def build_trace(node_id):
|
||||
if not p.raw_payload or not p.raw_payload.latitude_i or not p.raw_payload.longitude_i:
|
||||
continue
|
||||
trace.append((p.raw_payload.latitude_i * 1e-7, p.raw_payload.longitude_i * 1e-7))
|
||||
if not trace:
|
||||
for raw_p in await store.get_packets_from(node_id, PortNum.POSITION_APP, limit=1):
|
||||
p = Packet.from_model(raw_p)
|
||||
if not p.raw_payload or not p.raw_payload.latitude_i or not p.raw_payload.longitude_i:
|
||||
continue
|
||||
trace.append((p.raw_payload.latitude_i * 1e-7, p.raw_payload.longitude_i * 1e-7))
|
||||
return trace
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user