Skip to content

Commit 6437959

Browse files
committed
change(tools): Use esptool to detect available ports
This changes how available ports are detected. It removes code duplication for MacOS filtering which already is in esptool and prepares for port prioritization to be used from esptool.
1 parent 448b5c0 commit 6437959

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

tools/idf_py_actions/tools.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,8 @@ def get_default_serial_port() -> Any:
133133
# ensured that pyserial has been installed
134134
try:
135135
import esptool
136-
import serial.tools.list_ports
137136

138-
ports = list(sorted(p.device for p in serial.tools.list_ports.comports()))
139-
if sys.platform == 'darwin':
140-
ports = [port for port in ports if not port.endswith(('Bluetooth-Incoming-Port', 'wlan-debug'))]
137+
ports = esptool.get_port_list()
141138
# high baud rate could cause the failure of creation of the connection
142139
esp = esptool.get_default_connected_device(
143140
serial_list=ports, port=None, connect_attempts=4, initial_baud=115200

0 commit comments

Comments
 (0)