Skip to content

Commit 5561db6

Browse files
committed
added optional tag in receive and cleaned up pylint issues
1 parent 507aa64 commit 5561db6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

adafruit_ble_radio.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
try:
2626
from typing import Optional
2727
import _bleio
28-
from circuitpython_typing import ReadableBuffer, WriteableBuffer
28+
from circuitpython_typing import ReadableBuffer
2929
except ImportError:
3030
pass
3131

@@ -112,7 +112,7 @@ def __init__(self, **args):
112112
# Handle user related configuration.
113113
self.configure(**args)
114114

115-
def configure(self, channel: int=42) -> ValueError:
115+
def configure(self, channel: int = 42) -> ValueError:
116116
"""
117117
Set configuration values for the radio.
118118
@@ -152,7 +152,7 @@ def send_bytes(self, message: bytes) -> None:
152152
time.sleep(AD_DURATION)
153153
self.ble.stop_advertising()
154154

155-
def receive(self, timeout: float=1.0) -> str:
155+
def receive(self, timeout: float = 1.0) -> Optional[str]:
156156
"""
157157
Returns a message received on the channel on which the radio is
158158
listening.
@@ -166,7 +166,9 @@ def receive(self, timeout: float=1.0) -> str:
166166
return msg[0].decode("utf-8").replace("\x00", "")
167167
return None
168168

169-
def receive_full(self, timeout: float=1.0) -> Optional[tuple[ReadableBuffer, int, float]]:
169+
def receive_full(
170+
self, timeout: float = 1.0
171+
) -> Optional[tuple[ReadableBuffer, int, float]]:
170172
"""
171173
Returns a tuple containing three values representing a message received
172174
on the channel on which the radio is listening. If no message was

0 commit comments

Comments
 (0)