Skip to content

Commit 2245ac8

Browse files
author
Travis-L-R
committed
Shifting serial interface connection parts from __init__() into connect() method
1 parent 040f332 commit 2245ac8

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

meshtastic/serial_interface.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ def __init__(
5050
else:
5151
self.devPath = ports[0]
5252

53+
StreamInterface.__init__(
54+
self, debugOut=debugOut, noProto=noProto, connectNow=connectNow, noNodes=noNodes, timeout=timeout
55+
)
56+
57+
def connect(self) -> None:
5358
logger.debug(f"Connecting to {self.devPath}")
5459

5560
if sys.platform != "win32":
@@ -63,9 +68,7 @@ def __init__(
6368
self.stream.flush() # type: ignore[attr-defined]
6469
time.sleep(0.1)
6570

66-
StreamInterface.__init__(
67-
self, debugOut=debugOut, noProto=noProto, connectNow=connectNow, noNodes=noNodes, timeout=timeout
68-
)
71+
super().connect()
6972

7073
def _set_hupcl_with_termios(self, f: TextIOWrapper):
7174
"""first we need to set the HUPCL so the device will not reboot based on RTS and/or DTR

0 commit comments

Comments
 (0)