|
@@ -14,6 +14,7 @@ from bleak.backends.device import BLEDevice
|
|
from bleak.backends.service import BleakGATTCharacteristic, BleakGATTServiceCollection
|
|
from bleak.backends.service import BleakGATTCharacteristic, BleakGATTServiceCollection
|
|
from bleak.exc import BleakDBusError
|
|
from bleak.exc import BleakDBusError
|
|
from bleak_retry_connector import (
|
|
from bleak_retry_connector import (
|
|
|
|
+ BLEAK_RETRY_EXCEPTIONS,
|
|
BleakClientWithServiceCache,
|
|
BleakClientWithServiceCache,
|
|
BleakNotFoundError,
|
|
BleakNotFoundError,
|
|
ble_device_has_changed,
|
|
ble_device_has_changed,
|
|
@@ -37,12 +38,6 @@ DEVICE_SET_EXTENDED_KEY = REQ_HEADER
|
|
|
|
|
|
KEY_PASSWORD_PREFIX = "571"
|
|
KEY_PASSWORD_PREFIX = "571"
|
|
|
|
|
|
-BLEAK_EXCEPTIONS = (
|
|
|
|
- AttributeError,
|
|
|
|
- BleakError,
|
|
|
|
- EOFError,
|
|
|
|
- asyncio.exceptions.TimeoutError,
|
|
|
|
-)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -181,7 +176,7 @@ class SwitchbotBaseDevice:
|
|
self.rssi,
|
|
self.rssi,
|
|
exc_info=True,
|
|
exc_info=True,
|
|
)
|
|
)
|
|
- except BLEAK_EXCEPTIONS:
|
|
+ except BLEAK_RETRY_EXCEPTIONS:
|
|
if attempt == retry:
|
|
if attempt == retry:
|
|
_LOGGER.error(
|
|
_LOGGER.error(
|
|
"%s: communication failed; Stopping trying; RSSI: %s",
|
|
"%s: communication failed; Stopping trying; RSSI: %s",
|