Refactor activity names to use an enum instead of a string to avoid typos #147

This commit is contained in:
Ian Renton
2026-09-18 18:09:41 +01:00
parent ab79e7e01c
commit e5caf7353d
61 changed files with 735 additions and 638 deletions
+3 -2
View File
@@ -2,6 +2,7 @@ from datetime import datetime
import pytz
from core.enums import ActivityName
from data.activity_ref import ActivityRef
from data.alert import Alert
from providers.alert.http_alert_provider import HTTPAlertProvider
@@ -34,11 +35,11 @@ class Hamsat(HTTPAlertProvider):
dx_calls=[source_alert["callsign"].upper()],
freqs_modes=freqs_modes,
comment=source_alert["comment"],
sig="Satellite",
sig=ActivityName.SATELLITE,
# Fudge an activity ref to provide the remaining bits of data we need: the satellite and the operator's grid
sig_refs=[
ActivityRef(
sig="Satellite",
sig=ActivityName.SATELLITE,
id=f"{source_alert['satellite']['name']} from {source_alert['grids'][0]}",
)
],