Skip to content

Commit

Permalink
add handler for 0x2A05
Browse files Browse the repository at this point in the history
  • Loading branch information
patman15 committed Jan 6, 2025
1 parent 508c2f6 commit 374d5db
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions custom_components/bms_ble/plugins/daly_bms.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,18 @@ def _calc_values() -> set[str]:
ATTR_TEMPERATURE,
}

def _not_handler(self, _sender, data: bytearray) -> None:
self._log.debug("RX BLE data on 2a05: %s", data)

async def _init_connection(self) -> None:
"""Connect to the BMS and setup notification if not connected."""
await super()._init_connection()

if not self.name.startswith("DL-FB4"):
return

await self._client.start_notify("2a05", self._not_handler)

for char in ["ff01", "ff02", "fff1", "fff2", "fffa", "fffb", "fff3"]:
try:
self._log.debug(
Expand Down

0 comments on commit 374d5db

Please sign in to comment.