From 2dd8f645ba38e443f205356db5dc2f4d622bbdd4 Mon Sep 17 00:00:00 2001 From: Mikhail Geine Date: Wed, 10 Jan 2024 16:53:13 +0300 Subject: [PATCH] Fixed TimeoutError excess --- custom_components/skykettle/kettle_connection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/skykettle/kettle_connection.py b/custom_components/skykettle/kettle_connection.py index 1c67634..3ab75cb 100644 --- a/custom_components/skykettle/kettle_connection.py +++ b/custom_components/skykettle/kettle_connection.py @@ -60,9 +60,9 @@ async def command(self, command, params=[]): _LOGGER.debug(f"Writing command {command:02x}, data: [{' '.join([f'{c:02x}' for c in params])}]") data = bytes([0x55, self._iter, command] + list(params) + [0xAA]) # _LOGGER.debug(f"Writing {data}") + self._last_data = None await self._client.write_gatt_char(KettleConnection.UUID_TX, data) timeout_time = monotonic() + KettleConnection.BLE_RECV_TIMEOUT - self._last_data = None while True: await asyncio.sleep(0.05) if self._last_data: