CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-bleak

Cross-platform Bluetooth Low Energy GATT client library for asynchronous BLE communication

Overall
score

97%

Overview
Eval results
Files

task.mdevals/scenario-8/

BLE Connection Status Monitor

A tool that monitors and reports the connection status of Bluetooth Low Energy devices.

Capabilities

Connection Status Checking

Implement a monitor that tracks whether a BLE device is currently connected. The monitor should:

  • Check the connection status before performing operations @test
  • Verify connection status remains accurate after successful connection @test
  • Confirm connection status reflects disconnection @test
  • Handle status checks when device was never connected @test

Implementation

@generates

API

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.
        """
        pass

Dependencies { .dependencies }

bleak { .dependency }

Provides Bluetooth Low Energy support for device connection and status checking.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/pypi-bleak

tile.json