Alerts now displays a "Type" in the table not just the source. Closes #142

This commit is contained in:
Ian Renton
2026-09-11 14:43:33 +01:00
parent 8f8ff46426
commit 04f5df5260
11 changed files with 63 additions and 32 deletions
+8 -1
View File
@@ -22,11 +22,18 @@ class Hamsat(HTTPAlertProvider):
# Iterate through source data
for source_alert in http_response.json()["data"]:
# Convert to our alert format
freqs_modes = source_alert.get("mode", "")
if "mhz" in source_alert:
if "mhz_direction" in source_alert:
freqs_modes = f"{source_alert['mhz']!s} {source_alert['mhz_direction']}, {freqs_modes}"
else:
freqs_modes = f"{source_alert['mhz']!s}, {freqs_modes}"
alert = Alert(
source=self.name,
source_id=source_alert["id"],
dx_calls=[source_alert["callsign"].upper()],
freqs_modes=f"{source_alert['mhz']!s} {source_alert['mhz_direction']}, {source_alert['mode']}",
freqs_modes=freqs_modes,
comment=source_alert["comment"],
# Fudge a SIG ref to provide the remaining bits of data we need: the satellite and the operator's grid
sig_refs=[