Bluetooth Adapters

2.1.1 · active · verified Wed Apr 15

bluetooth-adapters is a Python library that provides tools to enumerate and find Bluetooth adapters on various operating systems. It is currently at version 2.1.1 and receives regular updates, typically every few months, addressing bugs and dependency updates.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to asynchronously retrieve and print information about available Bluetooth adapters on the system. It uses `get_adapter_manager` to get the system's adapter manager and then fetches all detected adapters.

import asyncio
from bluetooth_adapters import get_adapter_manager

async def main():
    manager = await get_adapter_manager()
    adapters = await manager.adapters()
    if not adapters:
        print("No Bluetooth adapters found.")
        return

    print(f"Found {len(adapters)} Bluetooth adapter(s):")
    for adapter in adapters:
        print(f"- Adapter: {adapter.name} ({adapter.address}) "
              f"Powered: {adapter.powered} Discovering: {adapter.discovering}")

if __name__ == "__main__":
    asyncio.run(main())

view raw JSON →