ble - add handler for bleakdbuserror exception
This commit is contained in:
1 parent
a07c831388
commit
afba5bcf62
1 file changed
+4
-1
+4
-1
@@ -137,7 +137,10 @@ def sensor_data_query(mac_list: List[str]) -> List[dict]:
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.error(f"Error reading BLE data - {e}")
|
log.error(f"Error reading BLE data - {e}")
|
||||||
this_result = None
|
this_result = None
|
||||||
if "org.freedesktop.DBus.Error.AccessDenied" in e:
|
if "org.freedesktop.DBus.Error.AccessDenied" in str(e):
|
||||||
|
reset_adapter()
|
||||||
|
return result
|
||||||
|
if "argument of type 'BleakDBusError' is not iterable" in str(e):
|
||||||
reset_adapter()
|
reset_adapter()
|
||||||
return result
|
return result
|
||||||
if this_result:
|
if this_result:
|
||||||
|
|||||||
Reference in new issue
Block a user