diff --git a/custom_components/linak_desk/api/device.py b/custom_components/linak_desk/api/device.py index 1ef45f6..e98c628 100644 --- a/custom_components/linak_desk/api/device.py +++ b/custom_components/linak_desk/api/device.py @@ -74,7 +74,7 @@ class Device: def disconnected_callback(self, client): """Callback for when the device is disconnected""" - _LOGGER.warning("Disconnected from %s", self._mac) + _LOGGER.info("Disconnected from %s", self._mac) self._is_connected = False async def _read_model(self): @@ -163,6 +163,7 @@ class Device: except BleakError as error: if self._is_connected: + self._connection.disconnect() raise error async def move_to_height(self, height: float) -> None: @@ -181,7 +182,7 @@ class Device: while True: await self._write(UUID_REFERENCE_INPUT, encoded_height) - await asyncio.sleep(0.5) + await asyncio.sleep(0.2) _height, speed = parse_height_speed(await self._read(UUID_HEIGHT)) if speed == 0: break