mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-20 14:27:42 +00:00
Allow QRP spots from PnP APIs #147
This commit is contained in:
@@ -37,10 +37,6 @@ class ParksNPeaks(HTTPAlertProvider):
|
|||||||
datetime.strptime(source_alert["alTime"], "%Y-%m-%d %H:%M:%S").replace(tzinfo=pytz.UTC).timestamp()
|
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
|
# Convert to our alert format
|
||||||
|
|||||||
@@ -65,16 +65,17 @@ class ParksNPeaks(HTTPSpotProvider):
|
|||||||
if not spot.de_call and m:
|
if not spot.de_call and m:
|
||||||
spot.de_call = str(m.group(1))
|
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
|
# Record activity information
|
||||||
# programme with a defined set of references
|
|
||||||
activity = source_spot["actClass"].upper()
|
activity = source_spot["actClass"].upper()
|
||||||
ref_id = source_spot["actSiteID"]
|
ref_id = source_spot["actSiteID"]
|
||||||
if activity and activity != "" and activity != ActivityName.QRP and ref_id and ref_id != "":
|
if activity:
|
||||||
spot.sig = activity
|
spot.sig = activity
|
||||||
|
activity_refs = []
|
||||||
|
if ref_id:
|
||||||
activity_refs = [
|
activity_refs = [
|
||||||
ActivityRef(
|
ActivityRef(
|
||||||
id=source_spot["actSiteID"],
|
id=source_spot["actSiteID"],
|
||||||
sig=source_spot["actClass"].upper(),
|
sig=activity,
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
spot.sig_refs = activity_refs
|
spot.sig_refs = activity_refs
|
||||||
|
|||||||
Reference in New Issue
Block a user