From 97e6273d3e256e01090f64ab6838df72d90a06f4 Mon Sep 17 00:00:00 2001 From: Petko Bordjukov Date: Wed, 25 Jan 2023 00:45:54 +0200 Subject: [PATCH] Make sure we request a response when writing to a GATT characteristic --- .../dbuezas_eq3btsmart/python_eq3bt/eq3bt/bleakconnection.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/dbuezas_eq3btsmart/python_eq3bt/eq3bt/bleakconnection.py b/custom_components/dbuezas_eq3btsmart/python_eq3bt/eq3bt/bleakconnection.py index 96851d0..1a28061 100644 --- a/custom_components/dbuezas_eq3btsmart/python_eq3bt/eq3bt/bleakconnection.py +++ b/custom_components/dbuezas_eq3btsmart/python_eq3bt/eq3bt/bleakconnection.py @@ -168,7 +168,7 @@ async def on_notification(self, handle: BleakGATTCharacteristic, data: bytearray ) async def async_make_request(self, value, retries=RETRIES): - """Write a GATT Command without callback - not utf-8.""" + """Write a GATT Command with callback - not utf-8.""" async with self._lock: # only one concurrent request per thermostat try: await self._async_make_request_try(value, retries) @@ -188,7 +188,7 @@ async def _async_make_request_try(self, value, retries): if value != "ONLY CONNECT": await conn.start_notify(PROP_NTFY_UUID, self.on_notification) try: - await conn.write_gatt_char(PROP_WRITE_UUID, value) + await conn.write_gatt_char(PROP_WRITE_UUID, value, response=True) await asyncio.wait_for( self._notify_event.wait(), REQUEST_TIMEOUT )