Allow spots and alerts to have multiple activities #143

This commit is contained in:
Ian Renton
2026-09-24 22:57:46 +01:00
parent 81166dccab
commit 4477942bec
34 changed files with 217 additions and 157 deletions
+3 -2
View File
@@ -2,7 +2,7 @@ from datetime import datetime
import pytz
from core.enums import ActivityName
from core.enums import ActivityName, ActivityRefType
from data.activity_ref import ActivityRef
from data.alert import Alert
from providers.alert.http_alert_provider import HTTPAlertProvider
@@ -38,12 +38,13 @@ class Hamsat(HTTPAlertProvider):
dx_grid=source_alert["grids"][0],
freqs_modes=freqs_modes,
comment=source_alert["comment"],
activity=ActivityName.SATELLITE,
activities=[ActivityName.SATELLITE],
# Fudge an activity ref to provide the remaining bits of data we need: the satellite and the operator's grid
activity_refs=[
ActivityRef(
activity=ActivityName.SATELLITE,
id=source_alert["satellite"]["name"],
ref_type=ActivityRefType.SATELLITE
)
],
start_time=datetime.strptime(source_alert["aos_at"], "%Y-%m-%dT%H:%M:%SZ")