From cfae77fe8e97e94dce1990ce955457a880607e37 Mon Sep 17 00:00:00 2001 From: Sam Rodgers Date: Fri, 30 Aug 2024 17:40:57 +0100 Subject: [PATCH 01/10] Add support for 2.4Ghz USB --- .../commands/EpomakerPollCommand.py | 15 +++++++++++++++ src/epomakercontroller/epomakercontroller.py | 15 +++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 src/epomakercontroller/commands/EpomakerPollCommand.py diff --git a/src/epomakercontroller/commands/EpomakerPollCommand.py b/src/epomakercontroller/commands/EpomakerPollCommand.py new file mode 100644 index 0000000..9fb504e --- /dev/null +++ b/src/epomakercontroller/commands/EpomakerPollCommand.py @@ -0,0 +1,15 @@ +"""Command for polling the keyboard on 2.4Ghz wireless.""" + +from .EpomakerCommand import EpomakerCommand +from .reports.Report import Report + + +class EpomakerPollCommand(EpomakerCommand): + """A command for polling the keyboard on 2.4Ghz wireless.""" + + def __init__(self) -> None: + """Initializes the poll. + """ + initialization_data = "f7" + initial_report = Report(initialization_data, index=0, checksum_index=None) + super().__init__(initial_report) diff --git a/src/epomakercontroller/epomakercontroller.py b/src/epomakercontroller/epomakercontroller.py index 1c214a0..6b4e4db 100644 --- a/src/epomakercontroller/epomakercontroller.py +++ b/src/epomakercontroller/epomakercontroller.py @@ -20,6 +20,7 @@ EpomakerTempCommand, EpomakerCpuCommand, EpomakerKeyRGBCommand, + EpomakerPollCommand, ) from .commands.data.constants import BUFF_LENGTH @@ -28,7 +29,7 @@ PRODUCT_IDS_WIRED = [0x4010, 0x4015] PRODUCT_IDS_24G = [0x4011, 0x4016] -USE_WIRELESS = False +USE_WIRELESS = True PRODUCT_IDS = PRODUCT_IDS_WIRED if USE_WIRELESS: PRODUCT_IDS += PRODUCT_IDS_24G @@ -249,7 +250,8 @@ def _select_device_path(hid_infos: list[HIDInfo]) -> Optional[bytes]: ) def _send_command( - self, command: EpomakerCommand.EpomakerCommand, sleep_time: float = 0.1 + self, command: EpomakerCommand.EpomakerCommand, sleep_time: float = 0.1, + poll_first: bool = False ) -> None: """Sends a command to the HID device. @@ -257,6 +259,7 @@ def _send_command( command (EpomakerCommand): The command to send. sleep_time (float): The time to sleep between sending packets (default: 0.1). + poll_first(bool): Whether or not to poll the device first """ assert command.report_data_prepared for packet in command: @@ -264,6 +267,8 @@ def _send_command( if self.dry_run: print(f"Dry run: skipping command send: {packet!r}") elif self.device: + if poll_first: + self.poll() self.device.send_feature_report(packet.get_all_bytes()) time.sleep(sleep_time) @@ -317,6 +322,7 @@ def send_temperature(self, temperature: int) -> None: temperature_command = EpomakerTempCommand.EpomakerTempCommand(temperature) self._send_command(temperature_command) + def send_cpu(self, cpu: int, from_daemon: bool = False) -> None: """Sends the CPU percentage to the HID device. @@ -344,6 +350,11 @@ def send_keys(self, frames: list[EpomakerKeyRGBCommand.KeyboardRGBFrame]) -> Non rgb_command = EpomakerKeyRGBCommand.EpomakerKeyRGBCommand(frames) self._send_command(rgb_command) + def poll(self) -> None: + poll_command = EpomakerPollCommand.EpomakerPollCommand() + self._send_command(poll_command, poll_first=False) + _ = self.device.get_feature_report(0x00, 128) + def close_device(self) -> None: """Closes the USB HID device.""" if self.device: From 6b05e60d50b066b9547970df54072a2440e96481 Mon Sep 17 00:00:00 2001 From: Keyboard Destroyer Date: Mon, 16 Feb 2026 22:22:15 +0300 Subject: [PATCH 02/10] Removed deprecated config values from epomakercontroller.py --- src/epomakercontroller/epomakercontroller.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/epomakercontroller/epomakercontroller.py b/src/epomakercontroller/epomakercontroller.py index 463d988..7347f11 100644 --- a/src/epomakercontroller/epomakercontroller.py +++ b/src/epomakercontroller/epomakercontroller.py @@ -67,11 +67,6 @@ class HIDInfo: event_path: str hid_path: Optional[str] = None -USE_WIRELESS = False -PRODUCT_IDS = PRODUCT_IDS_WIRED -if USE_WIRELESS: - PRODUCT_IDS += PRODUCT_IDS_24G - class EpomakerController(ControllerBase): COMMAND_MIN_DELAY = 1 / 1000 # ms. From 65a7c13763fdad32363b675b0febecd4042acfc2 Mon Sep 17 00:00:00 2001 From: Keyboard Destroyer Date: Thu, 19 Feb 2026 23:04:30 +0300 Subject: [PATCH 03/10] Ported initialization command from .cs file --- .../commands/EpomakerWirelessInitCommand.py | 50 +++++++++++++++++++ src/epomakercontroller/epomakercontroller.py | 14 ++++-- tests/fake/fake_controller.py | 16 +++++- tests/test_wireless_init_command.py | 29 +++++++++++ 4 files changed, 104 insertions(+), 5 deletions(-) create mode 100644 src/epomakercontroller/commands/EpomakerWirelessInitCommand.py create mode 100644 tests/test_wireless_init_command.py diff --git a/src/epomakercontroller/commands/EpomakerWirelessInitCommand.py b/src/epomakercontroller/commands/EpomakerWirelessInitCommand.py new file mode 100644 index 0000000..41f31a8 --- /dev/null +++ b/src/epomakercontroller/commands/EpomakerWirelessInitCommand.py @@ -0,0 +1,50 @@ +""" +Todo: write docstrings for this class +""" + +from .EpomakerCommand import EpomakerCommand, CommandStructure +from .reports.Report import Report + + +class EpomakerWirelessInitCommand(EpomakerCommand): + CHUNKS = [ + "f60a", + "8f00000000000070", + "fc", + "8700000000000078", + "fc", + "800000000000007f", + "fc", + "ad00000000000052", + "fc", + "840000000000007b", + "fc", + "850000000000007a", + "fc", + "8700000000000078", + "fc", + "8600000000000079", + "fc", + "910000000000006e", + "fc", + "920000000000006d", + "fc", + "9700000000000068" + "fc", + ] + + def __init__(self): + initialization_data = "fe40" + initial_report = Report(initialization_data, index=0, checksum_index=None) + structure = CommandStructure( + number_of_starter_reports=1, + number_of_data_reports=len(self.CHUNKS), + number_of_footer_reports=0, + ) + super().__init__(initial_report, structure) + + def prepare_from_sequence(self) -> None: + for report_index in range(0, self.structure.number_of_data_reports): + chunk = self.CHUNKS[report_index] + report = Report(chunk, index=report_index + self.structure.number_of_starter_reports, checksum_index=None) + self._insert_report(report) diff --git a/src/epomakercontroller/epomakercontroller.py b/src/epomakercontroller/epomakercontroller.py index 7347f11..0e55298 100644 --- a/src/epomakercontroller/epomakercontroller.py +++ b/src/epomakercontroller/epomakercontroller.py @@ -16,6 +16,7 @@ from datetime import datetime from json import dumps +from .commands.EpomakerWirelessInitCommand import EpomakerWirelessInitCommand from .configs.constants import TMP_FILE_PATH, RULE_FILE_PATH from .logger.logger import Logger from .utils.sensors import get_cpu_usage, get_device_temp @@ -304,7 +305,7 @@ def _select_device_path(self, hid_infos: list[HIDInfo]) -> Optional[bytes]: ) def _send_command( - self, command: EpomakerCommand.EpomakerCommand, sleep_time: float = 0.1, + self, command: EpomakerCommand.EpomakerCommand, sleep_time: float = 1 / 1000, poll_first: bool = False ) -> None: """Sends a command to the HID device. @@ -338,7 +339,7 @@ def _send_command( # We need to give some time for the screen to process out report # Otherwise it will hang processing queue # Not the best way to do it tho, but at least it works... - with TimeHelper(min_duration=EpomakerController.COMMAND_MIN_DELAY): + with TimeHelper(min_duration=sleep_time): self.device.send_feature_report(packet.get_all_bytes()) @staticmethod @@ -356,6 +357,14 @@ def _check_range(value: int, r: range | None = None) -> bool: r = range(0, 100) # 0 to 99 return value in r + def send_wireless_init(self): + """ + Sends wireless init command to the HID device. Required before 2.4GHz mode usage + """ + command = EpomakerWirelessInitCommand() + command.prepare_from_sequence() + self._send_command(command, poll_first=True) + def send_image(self, image_path: str) -> None: """Sends an image to the HID device. @@ -407,7 +416,6 @@ def send_temperature(self, temperature: int | None) -> None: Logger.log_info(f"Sending temperature {temperature}C") self._send_command(temperature_command) - def send_cpu(self, cpu: int) -> None: """Sends the CPU percentage to the HID device. diff --git a/tests/fake/fake_controller.py b/tests/fake/fake_controller.py index c9821e4..a7bc050 100644 --- a/tests/fake/fake_controller.py +++ b/tests/fake/fake_controller.py @@ -1,7 +1,8 @@ from __future__ import annotations + import typing -from epomakercontroller.commands.EpomakerCommand import EpomakerCommand +from epomakercontroller.commands.EpomakerPollCommand import EpomakerPollCommand from epomakercontroller.epomakercontroller import EpomakerConfig, EpomakerController if typing.TYPE_CHECKING: @@ -31,5 +32,16 @@ def open_device(self, only_info: bool = False): def close_device(self): self.is_ready = False - def _send_command(self, command: EpomakerCommand): + def poll(self): + poll_command = EpomakerPollCommand() + self._send_command(poll_command, poll_first=False) + + def _send_command( + self, + command, + sleep_time: float = 1 / 1000, + poll_first: bool = False + ) -> None: + if poll_first: + self.poll() self.commands.append(command) diff --git a/tests/test_wireless_init_command.py b/tests/test_wireless_init_command.py new file mode 100644 index 0000000..753594c --- /dev/null +++ b/tests/test_wireless_init_command.py @@ -0,0 +1,29 @@ +from epomakercontroller.commands.EpomakerPollCommand import EpomakerPollCommand +from src.epomakercontroller.commands.EpomakerWirelessInitCommand import EpomakerWirelessInitCommand +from fake.fake_controller import FakeEpomakerController +import epomakercontroller.cli as cli + + +def test_wireless_command_init_data(): + controller = FakeEpomakerController(cli.CONFIG_MAIN) + controller.send_wireless_init() + + assert controller.commands + reports = controller.commands[1].reports # First will be poll command + assert reports + assert reports[0].header_format_string == "fe40" + + for index in range(1, len(reports)): + assert EpomakerWirelessInitCommand.CHUNKS[index - 1] == reports[index].header_format_string + + +def test_wireless_poll(): + controller = FakeEpomakerController(cli.CONFIG_MAIN) + controller.send_wireless_init() + + assert controller.commands + controller.commands.pop(1) + + for command in controller.commands: + assert isinstance(command, EpomakerPollCommand) + assert command.reports[0].header_format_string == "f7" # Poll command From 97e9940cd857b9d0e4aea56c8ef6957e8766bac3 Mon Sep 17 00:00:00 2001 From: kbrddestroyer Date: Fri, 20 Feb 2026 18:28:19 +0300 Subject: [PATCH 04/10] Fixed epomakercontroller to work with 2.4GHz adapter --- .../commands/EpomakerWirelessInitCommand.py | 2 ++ src/epomakercontroller/configs/constants.py | 6 ++-- src/epomakercontroller/epomakercontroller.py | 36 +++++-------------- tests/test_wireless_init_command.py | 2 +- 4 files changed, 14 insertions(+), 32 deletions(-) diff --git a/src/epomakercontroller/commands/EpomakerWirelessInitCommand.py b/src/epomakercontroller/commands/EpomakerWirelessInitCommand.py index 41f31a8..be83aa2 100644 --- a/src/epomakercontroller/commands/EpomakerWirelessInitCommand.py +++ b/src/epomakercontroller/commands/EpomakerWirelessInitCommand.py @@ -48,3 +48,5 @@ def prepare_from_sequence(self) -> None: chunk = self.CHUNKS[report_index] report = Report(chunk, index=report_index + self.structure.number_of_starter_reports, checksum_index=None) self._insert_report(report) + + self.report_data_prepared = True diff --git a/src/epomakercontroller/configs/constants.py b/src/epomakercontroller/configs/constants.py index 046d1b0..ba491e1 100644 --- a/src/epomakercontroller/configs/constants.py +++ b/src/epomakercontroller/configs/constants.py @@ -16,7 +16,7 @@ if not os.path.exists(ROOT_FOLDER): os.mkdir(ROOT_FOLDER) -TMP_FOLDER = os.path.abspath(ROOT_FOLDER + "tmp/") +TMP_FOLDER = os.path.abspath("./temp") ETC_FOLDER = os.path.abspath(ROOT_FOLDER + "etc/") # Create folder on Windows @@ -26,8 +26,8 @@ if not os.path.exists(ETC_FOLDER): os.mkdir(ETC_FOLDER) -RULE_FILE_PATH = ETC_FOLDER + "udev/rules.d/99-epomaker-rt100.rules" -TMP_FILE_PATH = TMP_FOLDER + "99-epomaker-rt100.rules" +RULE_FILE_PATH = ETC_FOLDER + "/udev/rules.d/99-epomaker-rt100.rules" +TMP_FILE_PATH = TMP_FOLDER + "/99-epomaker-rt100.rules" PATH_TO_DEFAULT_CONFIG = "src/epomakercontroller/configs/default.json" DAEMON_TIME_DELAY = 1.6 diff --git a/src/epomakercontroller/epomakercontroller.py b/src/epomakercontroller/epomakercontroller.py index 0e55298..1d3b357 100644 --- a/src/epomakercontroller/epomakercontroller.py +++ b/src/epomakercontroller/epomakercontroller.py @@ -133,13 +133,12 @@ def open_device(self, only_info: bool = False) -> bool: if only_info: return True - # Find the device with the specified interface number so we can open by path - # This way we don't block usage of the keyboard whilst the device is open - device_path = self._find_device_path() - if device_path is None: - return False + self._open_device(product_id) + + if self.config.use_wireless and self.device: + Logger.log_info("Sending wireless initialization sequence command") + self.send_wireless_init() - self._open_device(device_path) return self.device is not None @override @@ -166,14 +165,14 @@ def _find_product_id(self) -> Optional[int]: return None - def _open_device(self, device_path: bytes) -> None: + def _open_device(self, product_id: int) -> None: """Opens the USB HID device. Args: - device_path (bytes): The path to the device. + product_id (int): The product ID. """ try: - self.device.open_path(device_path) + self.device.open(self.config.vendor_id, product_id) except IOError as e: Logger.log_error( f"Failed to open device: {e}\n" @@ -237,25 +236,6 @@ def print_device_info(self) -> None: ) ) - def _find_device_path(self) -> Optional[bytes]: - """Finds the device path with the specified interface number. - - Returns: - Optional[bytes]: The device path if found, None otherwise. - """ - input_dir = "/sys/class/input" - hid_infos = EpomakerController._get_hid_infos( - input_dir, self.config.device_description - ) - - if not hid_infos: - Logger.log_warning(f"No events found with description: '{self.config.device_description}'") - return None - - EpomakerController._populate_hid_paths(hid_infos) - - return self._select_device_path(hid_infos) - @staticmethod def _get_hid_infos(input_dir: str, description: str) -> list[HIDInfo]: """Retrieve HID information based on the given description.""" diff --git a/tests/test_wireless_init_command.py b/tests/test_wireless_init_command.py index 753594c..23799f2 100644 --- a/tests/test_wireless_init_command.py +++ b/tests/test_wireless_init_command.py @@ -1,5 +1,5 @@ from epomakercontroller.commands.EpomakerPollCommand import EpomakerPollCommand -from src.epomakercontroller.commands.EpomakerWirelessInitCommand import EpomakerWirelessInitCommand +from epomakercontroller.commands.EpomakerWirelessInitCommand import EpomakerWirelessInitCommand from fake.fake_controller import FakeEpomakerController import epomakercontroller.cli as cli From 6358f963da38399c2f33847bca4a790f17478b0f Mon Sep 17 00:00:00 2001 From: kbrddestroyer Date: Fri, 20 Feb 2026 18:44:03 +0300 Subject: [PATCH 05/10] Fixed constants file --- src/epomakercontroller/configs/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/epomakercontroller/configs/constants.py b/src/epomakercontroller/configs/constants.py index ba491e1..0f9fe02 100644 --- a/src/epomakercontroller/configs/constants.py +++ b/src/epomakercontroller/configs/constants.py @@ -16,7 +16,7 @@ if not os.path.exists(ROOT_FOLDER): os.mkdir(ROOT_FOLDER) -TMP_FOLDER = os.path.abspath("./temp") +TMP_FOLDER = os.path.abspath("./.epomaker_controller") ETC_FOLDER = os.path.abspath(ROOT_FOLDER + "etc/") # Create folder on Windows From 931edc2ff7ecd8cf2ad91d23b3aed0ea8a239886 Mon Sep 17 00:00:00 2001 From: Keyboard Destroyer Date: Sat, 21 Feb 2026 13:46:07 +0300 Subject: [PATCH 06/10] Fixed constants.py file - now temp folder is created on Linux as well --- src/epomakercontroller/configs/constants.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/epomakercontroller/configs/constants.py b/src/epomakercontroller/configs/constants.py index 0f9fe02..debad99 100644 --- a/src/epomakercontroller/configs/constants.py +++ b/src/epomakercontroller/configs/constants.py @@ -21,11 +21,13 @@ # Create folder on Windows if os.name == "nt": - if not os.path.exists(TMP_FOLDER): - os.mkdir(TMP_FOLDER) if not os.path.exists(ETC_FOLDER): os.mkdir(ETC_FOLDER) +# Create temp folder in project path on Linux as well +if not os.path.exists(TMP_FOLDER): + os.mkdir(TMP_FOLDER) + RULE_FILE_PATH = ETC_FOLDER + "/udev/rules.d/99-epomaker-rt100.rules" TMP_FILE_PATH = TMP_FOLDER + "/99-epomaker-rt100.rules" PATH_TO_DEFAULT_CONFIG = "src/epomakercontroller/configs/default.json" From 4b24becf84794aa02232a0f4d3178f3e3ac69708 Mon Sep 17 00:00:00 2001 From: Keyboard Destroyer Date: Sat, 21 Feb 2026 13:49:46 +0300 Subject: [PATCH 07/10] Removed deprecated functions from EpomakerController class --- src/epomakercontroller/epomakercontroller.py | 48 -------------------- 1 file changed, 48 deletions(-) diff --git a/src/epomakercontroller/epomakercontroller.py b/src/epomakercontroller/epomakercontroller.py index 1d3b357..210e990 100644 --- a/src/epomakercontroller/epomakercontroller.py +++ b/src/epomakercontroller/epomakercontroller.py @@ -236,54 +236,6 @@ def print_device_info(self) -> None: ) ) - @staticmethod - def _get_hid_infos(input_dir: str, description: str) -> list[HIDInfo]: - """Retrieve HID information based on the given description.""" - hid_infos = [] - for event in os.listdir(input_dir): - if event.startswith("event"): - device_name_path = os.path.join(input_dir, event, "device", "name") - try: - with open(device_name_path, "r", encoding="utf-8") as f: - device_name = f.read().strip() - if re.search(description, device_name): - event_path = os.path.join(input_dir, event) - hid_infos.append( - HIDInfo(device_name, event_path) - ) - except FileNotFoundError: - continue - return hid_infos - - @staticmethod - def _populate_hid_paths(hid_infos: list[HIDInfo]) -> None: - """Populate the HID paths for each HIDInfo object in the list.""" - for hi in hid_infos: - device_symlink = os.path.join(hi.event_path, "device") - if not os.path.islink(device_symlink): - Logger.log_warning(f"No 'device' symlink found in {hi.event_path}") - continue - - hid_device_path = os.path.realpath(device_symlink) - match = re.search(r"\b\d+-[\d.]+:\d+\.\d+\b", hid_device_path) - hi.hid_path = match.group(0) if match else None - - def _select_device_path(self, hid_infos: list[HIDInfo]) -> Optional[bytes]: - """Select the appropriate device path based on interface preference.""" - device_name_filter = "Wireless" if self.config.use_wireless else "Wired" - filtered_devices = [h for h in hid_infos if device_name_filter in h.device_name] - - if not filtered_devices: - Logger.log_warning(f"Could not find {device_name_filter} interface") - return None - - selected_device = filtered_devices[0] - return ( - selected_device.hid_path.encode("utf-8") - if selected_device.hid_path - else None - ) - def _send_command( self, command: EpomakerCommand.EpomakerCommand, sleep_time: float = 1 / 1000, poll_first: bool = False From cc9b2328fe630e67151bf9739027514bf847de44 Mon Sep 17 00:00:00 2001 From: kbrddestroyer Date: Tue, 24 Feb 2026 13:23:48 +0300 Subject: [PATCH 08/10] Fixed initialization flow --- .../commands/EpomakerWirelessInitCommand.py | 2 +- src/epomakercontroller/epomakercontroller.py | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/epomakercontroller/commands/EpomakerWirelessInitCommand.py b/src/epomakercontroller/commands/EpomakerWirelessInitCommand.py index be83aa2..538dcca 100644 --- a/src/epomakercontroller/commands/EpomakerWirelessInitCommand.py +++ b/src/epomakercontroller/commands/EpomakerWirelessInitCommand.py @@ -29,7 +29,7 @@ class EpomakerWirelessInitCommand(EpomakerCommand): "fc", "920000000000006d", "fc", - "9700000000000068" + "9700000000000068", "fc", ] diff --git a/src/epomakercontroller/epomakercontroller.py b/src/epomakercontroller/epomakercontroller.py index 210e990..204874d 100644 --- a/src/epomakercontroller/epomakercontroller.py +++ b/src/epomakercontroller/epomakercontroller.py @@ -137,7 +137,7 @@ def open_device(self, only_info: bool = False) -> bool: if self.config.use_wireless and self.device: Logger.log_info("Sending wireless initialization sequence command") - self.send_wireless_init() + return self.device and self.send_wireless_init() return self.device is not None @@ -289,13 +289,22 @@ def _check_range(value: int, r: range | None = None) -> bool: r = range(0, 100) # 0 to 99 return value in r - def send_wireless_init(self): + @staticmethod + def __check_whistle_response(response: bytes): + return "01010168" in response.hex() + + def send_wireless_init(self) -> bool: """ Sends wireless init command to the HID device. Required before 2.4GHz mode usage """ + + if self.__check_whistle_response(bytes(self.poll())): + return True + command = EpomakerWirelessInitCommand() command.prepare_from_sequence() self._send_command(command, poll_first=True) + return self.__check_whistle_response(bytes(self.poll())) def send_image(self, image_path: str) -> None: """Sends an image to the HID device. @@ -416,10 +425,10 @@ def cycle_light_modes(self, sleep_seconds: int = 5) -> None: time.sleep(sleep_seconds) counter += 1 - def poll(self) -> None: + def poll(self) -> Any: poll_command = EpomakerPollCommand.EpomakerPollCommand() self._send_command(poll_command, poll_first=False) - _ = self.device.get_feature_report(0x00, 128) + return self.device.get_feature_report(0x00, 128) def set_profile(self, profile: Profile) -> None: """Set the keyboard profile.""" From 088ee779e8544a18f63ec701b8a1bab01b9b973a Mon Sep 17 00:00:00 2001 From: kbrddestroyer Date: Tue, 24 Feb 2026 13:30:58 +0300 Subject: [PATCH 09/10] Fixed related tests --- tests/fake/fake_controller.py | 1 + tests/test_wireless_init_command.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/fake/fake_controller.py b/tests/fake/fake_controller.py index a7bc050..fa58669 100644 --- a/tests/fake/fake_controller.py +++ b/tests/fake/fake_controller.py @@ -35,6 +35,7 @@ def close_device(self): def poll(self): poll_command = EpomakerPollCommand() self._send_command(poll_command, poll_first=False) + return b"01010168" def _send_command( self, diff --git a/tests/test_wireless_init_command.py b/tests/test_wireless_init_command.py index 23799f2..ba5786e 100644 --- a/tests/test_wireless_init_command.py +++ b/tests/test_wireless_init_command.py @@ -9,7 +9,7 @@ def test_wireless_command_init_data(): controller.send_wireless_init() assert controller.commands - reports = controller.commands[1].reports # First will be poll command + reports = controller.commands[2].reports # First will be poll command assert reports assert reports[0].header_format_string == "fe40" @@ -22,7 +22,7 @@ def test_wireless_poll(): controller.send_wireless_init() assert controller.commands - controller.commands.pop(1) + controller.commands.pop(2) for command in controller.commands: assert isinstance(command, EpomakerPollCommand) From 37295800f258f227a22604a7db524f02b75b1f02 Mon Sep 17 00:00:00 2001 From: kbrddestroyer Date: Tue, 24 Feb 2026 13:44:13 +0300 Subject: [PATCH 10/10] Remove unused import --- src/epomakercontroller/epomakercontroller.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/epomakercontroller/epomakercontroller.py b/src/epomakercontroller/epomakercontroller.py index b9e6af0..6bfd350 100644 --- a/src/epomakercontroller/epomakercontroller.py +++ b/src/epomakercontroller/epomakercontroller.py @@ -10,7 +10,6 @@ import os import time import subprocess -import re from typing import override from datetime import datetime