continue progressively typing things (SerialInterface/BLEInterface initializations)

This commit is contained in:
Ian McEwen
2024-05-11 22:27:31 -07:00
parent fef0e1b77f
commit ba2d6c9d93
3 changed files with 10 additions and 6 deletions

View File

@@ -6,6 +6,8 @@ import time
import serial # type: ignore[import-untyped]
from typing import Optional
import meshtastic.util
from meshtastic.stream_interface import StreamInterface
@@ -16,7 +18,7 @@ if platform.system() != "Windows":
class SerialInterface(StreamInterface):
"""Interface class for meshtastic devices over a serial link"""
def __init__(self, devPath=None, debugOut=None, noProto=False, connectNow=True):
def __init__(self, devPath: Optional[str]=None, debugOut=None, noProto=False, connectNow=True):
"""Constructor, opens a connection to a specified serial port, or if unspecified try to
find one Meshtastic device by probing
@@ -26,7 +28,7 @@ class SerialInterface(StreamInterface):
"""
self.noProto = noProto
self.devPath = devPath
self.devPath: Optional[str] = devPath
if self.devPath is None:
ports = meshtastic.util.findPorts(True)