Implement Parks n Peaks alert provider. Closes #56

This commit is contained in:
Ian Renton
2025-10-20 09:42:38 +01:00
parent b4d88a4770
commit ae72649df8
5 changed files with 84 additions and 1 deletions

View File

@@ -43,11 +43,17 @@ class ParksNPeaks(HTTPSpotProvider):
time=datetime.strptime(source_spot["actTime"], "%Y-%m-%d %H:%M:%S").replace(
tzinfo=pytz.UTC).timestamp())
# Free text location is not present in all spots, so only add it if it's set
if "actLocation" in source_spot and source_spot["actLocation"] != "":
spot.sig_refs_names = [source_spot["actLocation"]]
# PNP supports a bunch of programs which should have different icons
if spot.sig == "SiOTA":
spot.icon = "wheat-awn"
elif spot.sig == "ZLOTA":
spot.icon = "kiwi-bird"
elif spot.sig == "KRMNPA":
spot.icon = "earth-oceania"
elif spot.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
spot.icon = ""
@@ -80,6 +86,8 @@ class ParksNPeaks(HTTPSpotProvider):
spot.de_call = None
break
# Note there is currently no support for KRMNPA location lookup, see issue #61.
# If this is POTA, SOTA or WWFF data we already have it through other means, so ignore. Otherwise, add to
# the spot list.
if spot.sig not in ["POTA", "SOTA", "WWFF"]: