Skip to content

Commit

Permalink
fix: make _notification_handler a normal function
Browse files Browse the repository at this point in the history
Nothing is being awaited here and by making it a coro, each
notification has to spawn a new task which has to wait one
iteration of the event loop and increases latancy
  • Loading branch information
bdraco authored and kaechele committed Aug 18, 2024
1 parent 1d2ece8 commit d9cb976
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bonaparte/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def _validate_message(self, message: bytes | bytearray) -> None:
msg = f"Invalid fooer {message[-1]}. Message should end with {FOOTER}."
raise EfireMessageValueError(msg)

async def _notification_handler(
def _notification_handler(
self, _char: BleakGATTCharacteristic, message: bytearray
) -> None:
_LOGGER.debug(
Expand Down

0 comments on commit d9cb976

Please sign in to comment.