Partial fix for mypy issues

This commit is contained in:
Ian Renton
2026-09-20 20:42:16 +01:00
parent 93ea27510f
commit 203758fa2d
25 changed files with 244 additions and 147 deletions
+7 -4
View File
@@ -94,21 +94,24 @@ class SOTA(HTTPSpotProvider):
raise ValueError("SOTA API tokens are required. Please log into SOTA in order to spot to it.")
sig_ref = spot.sig_refs[0].id if spot.sig_refs else ""
if sig_ref:
if not spot.freq:
raise ValueError("SOTA API requires a frequency to be set.")
# Split reference into association and summit codes
ref_split = sig_ref.split("/")
# Figure out a valid mode. Borrowed this from PoLo :)
# https://github.com/ham2k/app-polo/blob/main/src/extensions/activities/sota/SOTAPostSelfSpot.js
mode = spot.mode
if mode and mode not in self.VALID_MODES:
mode = "Data"
mode_str = spot.mode.value if spot.mode else ""
if spot.mode and spot.mode not in self.VALID_MODES:
mode_str = "Data"
body = {
"activatorCallsign": spot.dx_call,
"associationCode": ref_split[0],
"summitCode": ref_split[1],
"frequency": spot.freq / 1000000.0,
"mode": mode or "",
"mode": mode_str,
"callsign": spot.de_call,
"comments": spot.comment or "",
"type": "TEST", # todo replatce with NORMAL/QRT once testing complete