fix fm tune

This commit is contained in:
2026-03-21 19:21:42 +01:00
parent 6c908989a1
commit 44ea0e19c1
+3 -1
View File
@@ -118,11 +118,13 @@ def process_command(tef: AutoFMAM, data: bytes, state: State, conn: socket.socke
if cmd.startswith(b"T"):
freq = int(cmd.decode().removeprefix("T").strip())
if freq < 153 or freq > 108000: continue
mode = TEF6686.TuneTo_Mode.FM_Jump
if tef.modulation == Modulation.AM: mode = TEF6686.TuneTo_Mode.Preset
tef.set_modulation(freq)
match tef.modulation:
case Modulation.FM:
freq //= 10
tef.Tune_To(TEF6686.TuneTo_Mode.FM_Jump, freq)
tef.Tune_To(mode, freq)
state.last_tune_fm = freq
case Modulation.AM:
tef.Tune_To(TEF6686.TuneTo_Mode.Preset, freq)