mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-21 14:57:42 +00:00
Partial fix for mypy issues
This commit is contained in:
+11
-8
@@ -90,22 +90,25 @@ class Tiles(HTTPSpotProvider):
|
||||
def submit_spot(self, spot: Spot, credentials: dict[str, str]) -> None:
|
||||
# Tiles on the air currently only supports *self* spots
|
||||
if spot.dx_call == spot.de_call:
|
||||
if not spot.freq:
|
||||
raise RuntimeError("The Tiles on the Air API requires a frequency to be set.")
|
||||
|
||||
# Figure out a valid mode. Borrowed this from PoLo :)
|
||||
# https://github.com/ham2k/app-polo/blob/main/src/extensions/activities/sota/SOTAPostSelfSpot.js
|
||||
if spot.mode:
|
||||
mode = spot.mode
|
||||
if mode not in self.VALID_MODES:
|
||||
if mode == "OLIVIA":
|
||||
mode = "Olivia"
|
||||
elif mode == "JS8":
|
||||
mode = "JS8Call"
|
||||
mode_str: str = spot.mode.value
|
||||
if spot.mode not in self.VALID_MODES:
|
||||
if spot.mode == "OLIVIA":
|
||||
mode_str = "Olivia"
|
||||
elif spot.mode == "JS8":
|
||||
mode_str = "JS8Call"
|
||||
else:
|
||||
mode = "Other"
|
||||
mode_str = "Other"
|
||||
|
||||
body = {
|
||||
"call_sign": spot.dx_call,
|
||||
"frequency": str(spot.freq / 1000000.0),
|
||||
"mode": mode or "",
|
||||
"mode": mode_str or "",
|
||||
"grid": spot.dx_grid or "",
|
||||
"comment": spot.comment or "",
|
||||
"lat": spot.dx_latitude or None,
|
||||
|
||||
Reference in New Issue
Block a user