mpremote: Do not list bogus devices.

Signed-off-by: Mark Blakeney <mark.blakeney@bullet-systems.net>
pull/14374/head
Mark Blakeney 2024-04-25 10:30:38 +10:00
rodzic 9c7f0659e2
commit d02d30a216
1 zmienionych plików z 10 dodań i 9 usunięć

Wyświetl plik

@ -20,16 +20,17 @@ def do_connect(state, args=None):
if dev == "list":
# List attached devices.
for p in sorted(serial.tools.list_ports.comports()):
print(
"{} {} {:04x}:{:04x} {} {}".format(
p.device,
p.serial_number,
p.vid if isinstance(p.vid, int) else 0,
p.pid if isinstance(p.pid, int) else 0,
p.manufacturer,
p.product,
if p.serial_number is not None:
print(
"{} {} {:04x}:{:04x} {} {}".format(
p.device,
p.serial_number,
p.vid if isinstance(p.vid, int) else 0,
p.pid if isinstance(p.pid, int) else 0,
p.manufacturer,
p.product,
)
)
)
# Don't do implicit REPL command.
state.did_action()
elif dev == "auto":