Skip to content

Commit

Permalink
Make sure we request a response when writing to a GATT characteristic (
Browse files Browse the repository at this point in the history
…#37) (#42)

Co-authored-by: Petko Bordjukov <[email protected]>
  • Loading branch information
dbuezas and ignisf authored Jan 26, 2023
1 parent 7da10c3 commit 528194e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
)
Expand Down

0 comments on commit 528194e

Please sign in to comment.