Attempt at making the desk move smoothly
This commit is contained in:
parent
61357b8e7a
commit
f5887f963f
1 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue