diff --git a/xrd.py b/xrd.py index 348e99b..134d17d 100644 --- a/xrd.py +++ b/xrd.py @@ -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)