Skip to main content

Python client library for WyBot pool robots (HTTP, MQTT, and BLE).

Project description

pywybot

A Python client library for WyBot pool robots. It provides the transport clients and data models used to talk to WyBot devices:

  • HTTP (WyBotHTTPClient) — cloud login and device/status retrieval.
  • MQTT (WyBotMQTTClient) — real-time status and command relay.
  • BLE (WyBotBLEClient) — local Bluetooth control using the AA55 binary protocol.

This library is transport-agnostic for Bluetooth: you inject a BluetoothAdapter that knows how to discover and resolve BLE devices, so the same client works under Home Assistant's Bluetooth stack or a bare bleak setup. It was extracted from the hass-wybot Home Assistant integration.

Installation

pip install pywybot

Usage

The client is fully async (aiohttp / aiomqtt).

Cloud (HTTP)

import aiohttp
from wybot import WyBotHTTPClient, WybotAuthError, WybotConnectionError

async with aiohttp.ClientSession() as session:
    # Pass a session to reuse it (e.g. Home Assistant's shared session);
    # omit it and the client creates and owns one (call await client.close()).
    client = WyBotHTTPClient("you@example.com", "password", session=session)
    try:
        await client.authenticate()
    except WybotAuthError:
        ...  # invalid credentials
    except WybotConnectionError:
        ...  # network/server error

    groups = await client.get_indexed_current_grouped_devices()

The HTTP client raises WybotAuthError for rejected credentials and WybotConnectionError for network failures (both subclass WybotError).

Bluetooth (BLE)

WyBotBLEClient takes a BluetoothAdapter:

from wybot import WyBotBLEClient, BluetoothAdapter


class MyAdapter:  # implements the BluetoothAdapter protocol
    def scanner_count(self) -> int: ...
    def discovered_devices(self): ...            # -> list[bleak BLEDevice]
    def device_from_address(self, address): ...  # -> BLEDevice | None


ble = WyBotBLEClient(MyAdapter())

Home Assistant supplies an adapter backed by homeassistant.components.bluetooth.

License

GPL-3.0-or-later. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pywybot-1.2.0.tar.gz (76.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pywybot-1.2.0-py3-none-any.whl (52.3 kB view details)

Uploaded Python 3

File details

Details for the file pywybot-1.2.0.tar.gz.

File metadata

  • Download URL: pywybot-1.2.0.tar.gz
  • Upload date:
  • Size: 76.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pywybot-1.2.0.tar.gz
Algorithm Hash digest
SHA256 56ed3d9d4e144c3a4a15c8d5ec68100ffa3d3286747c868c4d480b67934c258a
MD5 15251124ff679feedfe23a64a9824d86
BLAKE2b-256 b992a6f55545b0260af2179a23be998acfc11b3edce4b927d8c935a4fe8326f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for pywybot-1.2.0.tar.gz:

Publisher: publish.yml on bassrock/pywybot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pywybot-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: pywybot-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 52.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pywybot-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 61680a15ac4e1b639e3f5b600fb718f4ef6bdb15858136bf6e036e6657925e87
MD5 a8e52baaee355234dce23575c8da6da2
BLAKE2b-256 623e0fe69568555c74250889c0777d9cedcac0afc45aad8915c7c2566c73a036

See more details on using hashes here.

Provenance

The following attestation bundles were made for pywybot-1.2.0-py3-none-any.whl:

Publisher: publish.yml on bassrock/pywybot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page