Cross-platform Bluetooth Low Energy GATT client library for asynchronous BLE communication
Overall
score
97%
A tool that monitors and reports the connection status of Bluetooth Low Energy devices.
Implement a monitor that tracks whether a BLE device is currently connected. The monitor should:
@generates
class ConnectionMonitor:
"""Monitors the connection status of a BLE device."""
def __init__(self, device_address: str):
"""
Initialize the connection monitor for a specific device.
Args:
device_address: The Bluetooth address of the device to monitor
"""
pass
async def is_connected(self) -> bool:
"""
Check if the device is currently connected.
Returns:
True if connected, False otherwise
"""
pass
async def connect(self) -> None:
"""
Establish a connection to the device.
Raises:
Exception if connection fails
"""
pass
async def disconnect(self) -> None:
"""
Disconnect from the device if currently connected.
"""
passProvides Bluetooth Low Energy support for device connection and status checking.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/pypi-bleakdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9