Skip to content

Commit 9a15470

Browse files
committed
errors fixed, possibly ready for final review
1 parent 5561db6 commit 9a15470

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

adafruit_ble_radio.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
2424
"""
2525
try:
26-
from typing import Optional
26+
from typing import Optional, Tuple
2727
import _bleio
2828
from circuitpython_typing import ReadableBuffer
2929
except ImportError:
@@ -79,7 +79,7 @@ def matches(cls, entry: _bleio.ScanEntry) -> bool:
7979
)
8080

8181
@property
82-
def msg(self) -> bytes:
82+
def msg(self) -> ReadableBuffer:
8383
"""Raw radio data"""
8484
if _RADIO_DATA_ID not in self.manufacturer_data.data:
8585
return b""
@@ -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) -> None:
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) -> Optional[str]:
155+
def receive(self, timeout: float = 1.0) -> str:
156156
"""
157157
Returns a message received on the channel on which the radio is
158158
listening.
@@ -168,7 +168,7 @@ def receive(self, timeout: float = 1.0) -> Optional[str]:
168168

169169
def receive_full(
170170
self, timeout: float = 1.0
171-
) -> Optional[tuple[ReadableBuffer, int, float]]:
171+
) -> Optional[Tuple[ReadableBuffer, int, float]]:
172172
"""
173173
Returns a tuple containing three values representing a message received
174174
on the channel on which the radio is listening. If no message was

0 commit comments

Comments
 (0)