some changes

This commit is contained in:
2026-03-21 08:20:44 +01:00
parent 7b0f74a1e5
commit 42f428305b
2 changed files with 21 additions and 9 deletions
+4 -4
View File
@@ -3,7 +3,7 @@ from driver.base_tef import BaseTEF668X
from typing import overload, ParamSpec, TypeVar, Concatenate, Callable
from functools import wraps
import struct
from enum import Enum
from enum import IntEnum
P = ParamSpec("P")
T = TypeVar("T")
@@ -36,7 +36,7 @@ def pack(*values: int | SignedInt):
class TEF6686(BaseTEF668X):
def _pre_command_(self, wrap: Callable, data: bytes, read_bytes: int | None, out_parser: Callable | None): return data, read_bytes, out_parser
class TuneTo_Mode(Enum):
class TuneTo_Mode(IntEnum):
Preset = 1
Search = 2
FM_AF_Update = 3
@@ -44,9 +44,9 @@ class TEF6686(BaseTEF668X):
FM_Check = 5
End = 7
@_command_wrapper
def FM_Tune_To(self, mode: TuneTo_Mode, frequency: int | None): return b"\x20\x01\x01" + (pack(mode.value, frequency) if frequency is not None else pack(mode.value)), None, None
def FM_Tune_To(self, mode: TuneTo_Mode, frequency: int | None): return b"\x20\x01\x01" + (pack(mode, frequency) if frequency is not None else pack(mode)), None, None
@_command_wrapper
def AM_Tune_To(self, mode: TuneTo_Mode, frequency: int | None): return b"\x21\x01\x01" + (pack(mode.value, frequency) if frequency is not None else pack(mode.value)), None, None
def AM_Tune_To(self, mode: TuneTo_Mode, frequency: int | None): return b"\x21\x01\x01" + (pack(mode, frequency) if frequency is not None else pack(mode)), None, None
@_command_wrapper
def FM_Set_Tune_Options(self, afu_bw_mode: bool = False, afu_bandwidth: int = 2360, afu_mute_time: int = 1000, afu_sample_time: int = 2000):