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
+11 -8
View File
@@ -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,