Update API to have a sensible grouping of sig_refs rather than separate arrays of sig_refs, sig_refs_names and sig_refs_urls

This commit is contained in:
Ian Renton
2025-10-31 09:51:54 +00:00
parent 6c95e845a4
commit 0c5b5f2062
21 changed files with 93 additions and 93 deletions

View File

@@ -5,6 +5,7 @@ import pytz
from alertproviders.http_alert_provider import HTTPAlertProvider
from core.sig_utils import get_icon_for_sig
from data.alert import Alert
from data.sig_ref import SIGRef
# Alert provider for Summits on the Air
@@ -27,8 +28,7 @@ class SOTA(HTTPAlertProvider):
freqs_modes=source_alert["frequency"],
comment=source_alert["comments"],
sig="SOTA",
sig_refs=[source_alert["associationCode"] + "/" + source_alert["summitCode"]],
sig_refs_names=[source_alert["summitDetails"]],
sig_refs=[SIGRef(id=source_alert["associationCode"] + "/" + source_alert["summitCode"], name=source_alert["summitDetails"], url="https://www.sotadata.org.uk/en/summit/" + source_alert["summitCode"])],
icon=get_icon_for_sig("SOTA"),
start_time=datetime.strptime(source_alert["dateActivated"],
"%Y-%m-%dT%H:%M:%SZ").replace(tzinfo=pytz.UTC).timestamp(),