From 54d779f036b0e31bb01bb60b823a63c0b6f93b0c Mon Sep 17 00:00:00 2001 From: Ian Renton Date: Fri, 18 Sep 2026 20:56:46 +0100 Subject: [PATCH] Allow QRP spots from PnP APIs #147 --- providers/alert/parksnpeaks.py | 6 +----- providers/spot/parksnpeaks.py | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/providers/alert/parksnpeaks.py b/providers/alert/parksnpeaks.py index 3908d80..7e7b4aa 100644 --- a/providers/alert/parksnpeaks.py +++ b/providers/alert/parksnpeaks.py @@ -37,11 +37,7 @@ class ParksNPeaks(HTTPAlertProvider): datetime.strptime(source_alert["alTime"], "%Y-%m-%d %H:%M:%S").replace(tzinfo=pytz.UTC).timestamp() ) - activity_refs = [] - # PnP can give us an alert of class "QRP" which is the only one that's not a real activity in Spothole's - # list, so mask this out if we got it. - if activity != ActivityName.QRP: - activity_refs = [ActivityRef(id=ref_id, sig=activity, name=ref_name)] + activity_refs = [ActivityRef(id=ref_id, sig=activity, name=ref_name)] # Convert to our alert format alert = Alert( diff --git a/providers/spot/parksnpeaks.py b/providers/spot/parksnpeaks.py index dc9f2c0..45b0105 100644 --- a/providers/spot/parksnpeaks.py +++ b/providers/spot/parksnpeaks.py @@ -65,19 +65,20 @@ class ParksNPeaks(HTTPSpotProvider): if not spot.de_call and m: spot.de_call = str(m.group(1)) - # Record activity information. Sometimes we get an activity of "QRP", which we ignore as it's not a - # programme with a defined set of references + # Record activity information activity = source_spot["actClass"].upper() ref_id = source_spot["actSiteID"] - if activity and activity != "" and activity != ActivityName.QRP and ref_id and ref_id != "": + if activity: spot.sig = activity - activity_refs = [ - ActivityRef( - id=source_spot["actSiteID"], - sig=source_spot["actClass"].upper(), - ) - ] - spot.sig_refs = activity_refs + activity_refs = [] + if ref_id: + activity_refs = [ + ActivityRef( + id=source_spot["actSiteID"], + sig=activity, + ) + ] + spot.sig_refs = activity_refs # 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"] != "":