Icon lookup for SIGs in preparation for #47. Improved ZLOTA spotter lookup.

This commit is contained in:
Ian Renton
2025-10-20 10:33:18 +01:00
parent ae72649df8
commit a21782cb62
18 changed files with 89 additions and 60 deletions

View File

@@ -42,21 +42,9 @@ class ParksNPeaks(HTTPAlertProvider):
start_time=start_time,
is_dxpedition=False)
# PNP supports a bunch of programs which should have different icons
if alert.sig == "SiOTA":
alert.icon = "wheat-awn"
elif alert.sig == "ZLOTA":
alert.icon = "kiwi-bird"
elif alert.sig == "KRMNPA":
alert.icon = "earth-oceania"
elif alert.sig in ["POTA", "SOTA", "WWFF"]:
# Don't care about an icon as this will be rejected anyway, we have better data from POTA/SOTA/WWFF direct
alert.icon = ""
else:
# Unknown programme we've never seen before
logging.warn(
"PNP alert found with sig " + alert.sig + ", developer needs to add support for this and set an icon!")
alert.icon = "question"
# Log a warning for the developer if PnP gives us an unknown programme we've never seen before
if alert.sig not in ["POTA", "SOTA", "WWFF", "SiOTA", "ZLOTA", "KRMNPA"]:
logging.warn("PNP alert found with sig " + alert.sig + ", developer needs to add support for this!")
# If this is POTA, SOTA or WWFF data we already have it through other means, so ignore. Otherwise, add to
# the alert list.

View File

@@ -27,7 +27,6 @@ class POTA(HTTPAlertProvider):
sig="POTA",
sig_refs=[source_alert["reference"]],
sig_refs_names=[source_alert["name"]],
icon="tree",
start_time=datetime.strptime(source_alert["startDate"] + source_alert["startTime"],
"%Y-%m-%d%H:%M").replace(tzinfo=pytz.UTC).timestamp(),
end_time=datetime.strptime(source_alert["endDate"] + source_alert["endTime"],

View File

@@ -28,7 +28,6 @@ class SOTA(HTTPAlertProvider):
sig="SOTA",
sig_refs=[source_alert["associationCode"] + "/" + source_alert["summitCode"]],
sig_refs_names=[source_alert["summitDetails"]],
icon="mountain-sun",
start_time=datetime.strptime(source_alert["dateActivated"],
"%Y-%m-%dT%H:%M:%SZ").replace(tzinfo=pytz.UTC).timestamp(),
is_dxpedition=False)

View File

@@ -26,7 +26,6 @@ class WWFF(HTTPAlertProvider):
comment=source_alert["remarks"],
sig="WWFF",
sig_refs=[source_alert["reference"]],
icon="seedling",
start_time=datetime.strptime(source_alert["utc_start"],
"%Y-%m-%d %H:%M:%S").replace(tzinfo=pytz.UTC).timestamp(),
end_time=datetime.strptime(source_alert["utc_end"],