pycycling package

Subpackages

Submodules

Module contents

pycycling is a cross-platform Python package for interacting with various Bluetooth cycling peripherals.

The package provides a number of classes which wrap around Bleak client objects.

Obtaining the address of your device

This documentation includes a number of code snippets demonstrating package usage. Each of these has a hardcoded device address ID which you will need to replace with the address of your device. The following script can be used to obtain this address:

"""
An example script which lists all available bluetooth devices. Use this to obtain the device_address used in other
scripts
"""

import asyncio
from bleak import discover


async def run():
    devices = await discover()
    for d in devices:
        print(d)


if __name__ == "__main__":
    import os

    os.environ["PYTHONASYNCIODEBUG"] = str(1)

    loop = asyncio.get_event_loop()
    loop.run_until_complete(run())