Start converting some enum-like strings to proper enums, plus global reformat

This commit is contained in:
Ian Renton
2026-09-02 08:37:13 +01:00
parent 5a6fc19ab5
commit 606cf1be68
24 changed files with 81 additions and 79 deletions
+4 -4
View File
@@ -15,7 +15,7 @@ from core.constants import (
UNKNOWN_BAND,
)
from core.data_store import DATA_STORE
from core.enums import Continent
from core.enums import Continent, ModeType
from data.callsign import Callsign, LocationSourceForCallsign
logger = logging.getLogger(__name__)
@@ -44,11 +44,11 @@ def infer_mode_type_from_mode(mode):
"""Infer a "mode family" from a mode."""
if mode.upper() in CW_MODES:
return "CW"
return ModeType.CW
elif mode.upper() in PHONE_MODES:
return "PHONE"
return ModeType.PHONE
elif mode.upper() in DATA_MODES:
return "DATA"
return ModeType.DATA
else:
if mode.upper() != "OTHER" and mode != "?":
logger.warning(f"Found an unrecognised mode: {mode}. Developer should categorise this.")