fix
This commit is contained in:
@@ -128,7 +128,12 @@ def process_command(tef: AutoFMAM, data: bytes, state: State, conn: socket.socke
|
|||||||
mode = TEF6686.TuneTo_Mode.FM_Jump
|
mode = TEF6686.TuneTo_Mode.FM_Jump
|
||||||
if tef.modulation == Modulation.AM: mode = TEF6686.TuneTo_Mode.Preset
|
if tef.modulation == Modulation.AM: mode = TEF6686.TuneTo_Mode.Preset
|
||||||
|
|
||||||
tef.set_modulation(freq)
|
if freq < 27000: tef.modulation = Modulation.AM
|
||||||
|
elif freq > 64000: tef.modulation = Modulation.FM
|
||||||
|
else:
|
||||||
|
out += f"!Invalid frequency".encode()
|
||||||
|
continue
|
||||||
|
|
||||||
match tef.modulation:
|
match tef.modulation:
|
||||||
case Modulation.FM:
|
case Modulation.FM:
|
||||||
tef.FM_Tune_To(mode, freq // 10)
|
tef.FM_Tune_To(mode, freq // 10)
|
||||||
@@ -136,7 +141,7 @@ def process_command(tef: AutoFMAM, data: bytes, state: State, conn: socket.socke
|
|||||||
case Modulation.AM:
|
case Modulation.AM:
|
||||||
tef.AM_Tune_To(TEF6686.TuneTo_Mode.Preset, freq)
|
tef.AM_Tune_To(TEF6686.TuneTo_Mode.Preset, freq)
|
||||||
state.last_tune_am = tef.last_tune = freq
|
state.last_tune_am = tef.last_tune = freq
|
||||||
out += f"T{freq}\nM{tef.modulation}\n".encode()
|
out += f"T{freq}\nM{tef.modulation.value}\n".encode()
|
||||||
elif cmd.startswith(b"G"):
|
elif cmd.startswith(b"G"):
|
||||||
eqims = int(cmd.decode().removeprefix("G").strip(), 2)
|
eqims = int(cmd.decode().removeprefix("G").strip(), 2)
|
||||||
tef.FM_Set_ChannelEqualizer((eqims & 1) == 1)
|
tef.FM_Set_ChannelEqualizer((eqims & 1) == 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user