Split out event type SIGs, and do other enum conversions. Closes #138

This commit is contained in:
Ian Renton
2026-09-02 09:38:05 +01:00
parent 606cf1be68
commit 9d117a6069
54 changed files with 363 additions and 155 deletions
+7 -4
View File
@@ -1,6 +1,9 @@
import json
from datetime import datetime
import pytz
from core.enums import SIGRefType
from data.sig_ref import SIGRef
from data.spot import Spot
from providers.spot.http_spot_provider import HTTPSpotProvider
@@ -32,10 +35,10 @@ class Towers(HTTPSpotProvider):
freq=likely_freq,
comment=source_spot["comment"],
sig="Towers",
sig_refs=[SIGRef(id=source_spot["ref"], sig="Towers")],
time=datetime.strptime(
response_json["updated"][:10] + source_spot["time"], "%Y-%m-%d%H:%M"
).timestamp(),
sig_refs=[SIGRef(id=source_spot["ref"], sig="Towers", ref_type=SIGRefType.TOWER)],
time=datetime.strptime(response_json["updated"][:10] + source_spot["time"], "%Y-%m-%d%H:%M")
.replace(tzinfo=pytz.utc)
.timestamp(),
)
# Add to our list. Don't worry about de-duping, removing old spots etc. at this point; other code will do