Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions adafruit_rfm/rfm_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,13 +286,6 @@ async def asyncio_send( # noqa: PLR0912 PLR0913

Returns: True if success or False if the send timed out.
"""
# Disable pylint warning to not use length as a check for zero.
# This is a puzzling warning as the below code is clearly the most
# efficient and proper way to ensure a precondition that the provided
# buffer be within an expected range of bounds. Disable this check.
# pylint: disable=len-as-condition
assert 0 < len(data) <= self.max_packet_length
# pylint: enable=len-as-condition
self.idle() # Stop receiving to clear FIFO and keep it clear.
# Combine header and data to form payload
if self.radiohead:
Expand All @@ -318,6 +311,13 @@ async def asyncio_send( # noqa: PLR0912 PLR0913
payload = destination.to_bytes(1, "big") + data
else:
payload = data
# Disable pylint warning to not use length as a check for zero.
# This is a puzzling warning as the below code is clearly the most
# efficient and proper way to ensure a precondition that the provided
# buffer be within an expected range of bounds. Disable this check.
# pylint: disable=len-as-condition
assert 0 < len(payload) <= self.max_packet_length
# pylint: enable=len-as-condition
self.fill_fifo(payload)
# Turn on transmit mode to send out the packet.
self.transmit()
Expand Down