mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-21 06:47:42 +00:00
Partial fix for mypy issues
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user