aboutsummaryrefslogtreecommitdiff
path: root/examples/heart_rate_server.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/heart_rate_server.py')
-rw-r--r--examples/heart_rate_server.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/heart_rate_server.py b/examples/heart_rate_server.py
index fad809f..e40d5db 100644
--- a/examples/heart_rate_server.py
+++ b/examples/heart_rate_server.py
@@ -33,14 +33,16 @@ from bumble.utils import AsyncRunner
# -----------------------------------------------------------------------------
-async def main():
+async def main() -> None:
if len(sys.argv) != 3:
print('Usage: python heart_rate_server.py <device-config> <transport-spec>')
print('example: python heart_rate_server.py device1.json usb:0')
return
- async with await open_transport_or_link(sys.argv[2]) as (hci_source, hci_sink):
- device = Device.from_config_file_with_hci(sys.argv[1], hci_source, hci_sink)
+ async with await open_transport_or_link(sys.argv[2]) as hci_transport:
+ device = Device.from_config_file_with_hci(
+ sys.argv[1], hci_transport.source, hci_transport.sink
+ )
# Keep track of accumulated expended energy
energy_start_time = time.time()