Explorar o código

missing await

J. Nick Koston %!s(int64=2) %!d(string=hai) anos
pai
achega
4d6aac7f26
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      switchbot/devices/device.py

+ 2 - 2
switchbot/devices/device.py

@@ -226,10 +226,10 @@ class SwitchbotDevice:
         await self._ensure_connected()
         try:
             return await self._execute_command_locked(key, command)
-        except BleakError:
+        except BleakError as ex:
             # Disconnect so we can reset state and try again
             _LOGGER.debug(
-                "%s: Disconnecting due to error; RSSI: %s", self.name, self.rssi
+                "%s: RSSI: %s; Disconnecting due to error: %s", self.name, self.rssi, ex
             )
             await self._execute_disconnect()
             raise