mirror of
https://github.com/meshtastic/python.git
synced 2026-06-16 19:40:20 -04:00
continue progressively typing things (SerialInterface/BLEInterface initializations)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user