Improved map init time

This commit is contained in:
Mark Qvist 2025-03-14 17:13:02 +01:00
parent dd12a76bf9
commit 999054ab34

View File

@ -6155,7 +6155,7 @@ class SidebandApp(MDApp):
latest_viewable = None
if not skip:
for telemetry_entry in telemetry_entries[telemetry_source]:
for telemetry_entry in sorted(telemetry_entries[telemetry_source], key=lambda t: t[0], reverse=True):
telemetry_timestamp = telemetry_entry[0]
telemetry_data = telemetry_entry[1]
t = Telemeter.from_packed(telemetry_data)
@ -6164,6 +6164,10 @@ class SidebandApp(MDApp):
if "location" in telemetry and telemetry["location"] != None and telemetry["location"]["latitude"] != None and telemetry["location"]["longitude"] != None:
latest_viewable = telemetry
break
elif "connection_map" in telemetry:
# TODO: Telemetry entries with connection map sensor types are skipped for now,
# until a proper rendering mechanism is implemented
break
if latest_viewable != None:
l = latest_viewable["location"]