mirror of
https://github.com/esphome/esphome.git
synced 2026-09-22 04:28:43 +00:00
[core] Fix waiting for port indefinitely (#14688)
This commit is contained in:
+4
-2
@@ -919,9 +919,11 @@ def _wait_for_serial_port(
|
||||
"""
|
||||
|
||||
def _port_found() -> bool:
|
||||
ports = get_serial_ports()
|
||||
if port is not None:
|
||||
return any(p.path == port for p in ports)
|
||||
if os.name == "posix":
|
||||
return os.path.exists(port)
|
||||
return any(p.path == port for p in get_serial_ports())
|
||||
ports = get_serial_ports()
|
||||
if known_ports is not None:
|
||||
return any(p.path not in known_ports for p in ports)
|
||||
return bool(ports)
|
||||
|
||||
Reference in New Issue
Block a user