mirror of
https://github.com/meshtastic/python.git
synced 2026-02-02 03:51:20 -05:00
attempts to fix mypy issues
This commit is contained in:
@@ -104,7 +104,7 @@ def getPref(node, comp_name) -> bool:
|
||||
for config in [localConfig, moduleConfig]:
|
||||
objDesc = config.DESCRIPTOR
|
||||
config_type = objDesc.fields_by_name.get(name[0])
|
||||
pref = False #FIXME - checkme - Used here as boolean, but set 2 lines below as a string.
|
||||
pref = "" #FIXME - is this correct to leave as an empty string if not found?
|
||||
if config_type:
|
||||
pref = config_type.message_type.fields_by_name.get(snake_name)
|
||||
if pref or wholeField:
|
||||
|
||||
@@ -151,7 +151,7 @@ class BLEInterface(MeshInterface):
|
||||
)
|
||||
return addressed_devices[0]
|
||||
|
||||
def _sanitize_address(address: Optional[str]) -> Optional[str]: # pylint: disable=E0213
|
||||
def _sanitize_address(self, address: Optional[str]) -> Optional[str]: # pylint: disable=E0213
|
||||
"Standardize BLE address by removing extraneous characters and lowercasing."
|
||||
if address is None:
|
||||
return None
|
||||
|
||||
@@ -58,7 +58,7 @@ class SerialInterface(StreamInterface):
|
||||
self.stream = serial.Serial(
|
||||
self.devPath, 115200, exclusive=True, timeout=0.5, write_timeout=0
|
||||
)
|
||||
self.stream.flush()
|
||||
self.stream.flush() # type: ignore[attr-defined]
|
||||
time.sleep(0.1)
|
||||
|
||||
StreamInterface.__init__(
|
||||
|
||||
Reference in New Issue
Block a user