Skip to content

Commit

Permalink
ensure fresh data after command (#136)
Browse files Browse the repository at this point in the history
issue with JK BMS streaming data, fixes #133
  • Loading branch information
patman15 authored Dec 30, 2024
1 parent f9b8e68 commit 6f09c83
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions custom_components/bms_ble/plugins/basebms.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ async def _await_reply(
"""Send data to the BMS and wait for valid reply notification."""

self._log.debug("TX BLE data: %s", data.hex(" "))
self._data_event.clear() # clear event before requesting new data
await self._client.write_gatt_char(char or self.uuid_tx(), data)
if wait_for_notify:
await asyncio.wait_for(self._wait_event(), timeout=self.BAT_TIMEOUT)
Expand Down

0 comments on commit 6f09c83

Please sign in to comment.