tessl install tessl/pypi-bleak@1.1.0Cross-platform Bluetooth Low Energy GATT client library for asynchronous BLE communication
Agent Success
Agent success rate when using this tile
97%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.07x
Baseline
Agent success rate without this tile
91%
A Python utility for managing Bluetooth Low Energy (BLE) device pairings, focusing on device cleanup and connection management.
Build a command-line tool that allows users to connect to a BLE device, verify the connection, and then unpair the device to clean up system pairing records. This is useful for testing workflows, device reset scenarios, or managing temporary device connections.
The tool should:
@generates
import asyncio
from typing import Optional
async def find_device(address: str, timeout: float = 10.0) -> Optional[object]:
"""
Scan for a BLE device with the specified address.
Args:
address: The Bluetooth address of the device to find
timeout: Maximum time in seconds to scan for the device
Returns:
Device object if found, None otherwise
"""
pass
async def connect_device(device: object) -> bool:
"""
Connect to a BLE device.
Args:
device: The device object to connect to
Returns:
True if connection successful, False otherwise
"""
pass
async def unpair_device(client: object) -> bool:
"""
Unpair and disconnect from a BLE device.
Args:
client: The connected client object
Returns:
True if unpair successful, False otherwise
"""
pass
async def main(device_address: str) -> int:
"""
Main function to orchestrate the find, connect, and unpair workflow.
Args:
device_address: Bluetooth address of the device to manage
Returns:
Exit code (0 for success, 1 for failure)
"""
pass
if __name__ == "__main__":
import sys
if len(sys.argv) != 2:
print("Usage: python unpair_manager.py <device_address>")
sys.exit(1)
exit_code = asyncio.run(main(sys.argv[1]))
sys.exit(exit_code)Provides cross-platform Bluetooth Low Energy GATT client functionality for scanning, connecting, and managing BLE device pairings.
@satisfied-by