From adbfb328b201bea5da8777007568a7583d9e9016 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Sat, 29 Jun 2024 09:29:29 -0700 Subject: [PATCH] threads should aways be named (for debugability) --- meshtastic/ble_interface.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/meshtastic/ble_interface.py b/meshtastic/ble_interface.py index 9067878..9b9b602 100644 --- a/meshtastic/ble_interface.py +++ b/meshtastic/ble_interface.py @@ -19,10 +19,10 @@ FROMNUM_UUID = "ed9da18c-a800-4f66-a670-aa7547e34453" class BLEInterface(MeshInterface): - """MeshInterface using BLE to connect to devices""" + """MeshInterface using BLE to connect to devices.""" class BLEError(Exception): - """An exception class for BLE errors""" + """An exception class for BLE errors.""" def __init__(self, message): self.message = message @@ -54,7 +54,7 @@ class BLEInterface(MeshInterface): logging.debug("Threads running") try: - logging.debug(f"BLE connecting to: {address}") + logging.debug(f"BLE connecting to: {address if address else 'any'}") self.client = self.connect(address) self.state.BLE = True logging.debug("BLE connected") @@ -178,7 +178,7 @@ class BLEClient: """Client for managing connection to a BLE device""" def __init__(self, address=None, **kwargs): - self._eventThread = Thread(target=self._run_event_loop) + self._eventThread = Thread(target=self._run_event_loop, name="BLEClient") self._eventThread_started = Event() self._eventThread_stopped = Event() self._eventThread.start()