attempts to fix mypy issues

This commit is contained in:
William Stearns
2024-10-11 00:59:02 -04:00
parent 0da405168f
commit e335f12a3b
3 changed files with 3 additions and 3 deletions

View File

@@ -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:

View File

@@ -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

View File

@@ -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__(