Further alert implementation #17

This commit is contained in:
Ian Renton
2025-10-06 17:14:52 +01:00
parent fdb2a445b8
commit e0675a01f0
7 changed files with 280 additions and 22 deletions

View File

@@ -33,7 +33,9 @@ class POTA(HTTPAlertProvider):
end_time=datetime.strptime(source_alert["endDate"] + source_alert["endTime"],
"%Y-%m-%d%H:%M").replace(tzinfo=pytz.UTC).timestamp())
# Add to our list. Don't worry about de-duping, removing old alerts etc. at this point; other code will do
# Add to our list, but exclude any old spots that POTA can sometimes give us where even the end time is
# in the past. Don't worry about de-duping, removing old alerts etc. at this point; other code will do
# that for us.
new_alerts.append(alert)
if alert.end_time > datetime.now(pytz.UTC).timestamp():
new_alerts.append(alert)
return new_alerts