Skip to content

Commit f0d174a

Browse files
committed
Ensure some Win compatiblity
1 parent 8db7f8c commit f0d174a

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

tui/rdm_search.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,11 @@ def get_device_parameters(ser: serial.Serial, discovered_uid: bytes, tn: int):
539539

540540

541541
def get_device_info(device_port):
542-
ser = serial.Serial(device_port, baudrate=250000, timeout=0.1)
542+
try:
543+
ser = serial.Serial(device_port, baudrate=250000, timeout=0.1)
544+
except Exception as e:
545+
print(e)
546+
return False
543547
robe_packet = build_robe_packet(PACKET_TYPE_RDM_INFO_COMMAND, b"")
544548
ser.write(robe_packet)
545549
time.sleep(0.2)

tui/screens.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ class ArtNetScreen(ModalScreen):
172172

173173
def compose(self) -> ComposeResult:
174174
with Vertical(id="all_around"):
175-
yield Static("Art-Net Discovery", id="question")
175+
yield Static("Discovery", id="question")
176176
with Horizontal(id="row2"):
177177
yield Button("Discover", id="do_start")
178178
yield Button("Close", id="close_discovery")
@@ -198,17 +198,16 @@ def get_robe_usb_devices(self) -> None:
198198
devices = []
199199
ports = serial.tools.list_ports.comports()
200200
for port in ports:
201-
if port.description and "Runit WTX" in port.description:
202-
print(f"Found port: {port.device} - {port.description}")
203-
if get_device_info(port.device):
204-
devices.append(port)
201+
print(f"Found port: {port.device} - {port.description}")
202+
if get_device_info(port.device):
203+
devices.append(port)
205204
self.app.call_from_thread(self.update_usb_devices_list, devices)
206205

207206
def update_usb_devices_list(self, devices: list) -> None:
208207
"""Update the Select widget with the found devices."""
209208
sel = self.query_one("#networks_select", Select)
210209
options = self.networks
211-
options += [(f"{port.product}: {port.device}", port.device) for port in devices]
210+
options += [(f"RUNIT: {port.device}", port.device) for port in devices]
212211
sel.set_options(options)
213212

214213
def on_button_pressed(self, event: Button.Pressed) -> None:

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)