From 3be73b42e219ab4c5235c77e417c7ee018357008 Mon Sep 17 00:00:00 2001 From: Travis-L-R <> Date: Tue, 11 Nov 2025 19:19:44 +1030 Subject: [PATCH] Removing unnecessary initialization of self.stream in TCPInterface --- meshtastic/stream_interface.py | 2 +- meshtastic/tcp_interface.py | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/meshtastic/stream_interface.py b/meshtastic/stream_interface.py index 1cd4db1..fc7e9bc 100644 --- a/meshtastic/stream_interface.py +++ b/meshtastic/stream_interface.py @@ -46,7 +46,7 @@ class StreamInterface(MeshInterface): raise RuntimeError( "StreamInterface is now abstract (to update existing code create SerialInterface instead)" ) - self.stream: Optional[serial.Serial] # only serial uses this, TCPInterface overrides the relevant methods instead + self.stream: Optional[serial.Serial] = None # only serial uses this, TCPInterface overrides the relevant methods instead self._rxBuf = bytes() # empty self._wantExit = False diff --git a/meshtastic/tcp_interface.py b/meshtastic/tcp_interface.py index 732f37e..c9bdc52 100644 --- a/meshtastic/tcp_interface.py +++ b/meshtastic/tcp_interface.py @@ -31,9 +31,6 @@ class TCPInterface(StreamInterface): hostname {string} -- Hostname/IP address of the device to connect to timeout -- How long to wait for replies (default: 300 seconds) """ - - self.stream = None - self.hostname: str = hostname self.portNumber: int = portNumber