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.1.0.tar.gz (74.6 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.1.0-py3-none-any.whl (51.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pywybot-1.1.0.tar.gz
Algorithm Hash digest
SHA256 4c5185ada10c40627cf1219e62ea6bbedefda7032a35ea48741c354b5a8eb525
MD5 79f88876c487cc28cc480c4c728a61c6
BLAKE2b-256 bb53c8b5cbd9349c6218772281294ffdcf8cd6a5e65731fa13340b3652db6123

See more details on using hashes here.

Provenance

The following attestation bundles were made for pywybot-1.1.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.1.0-py3-none-any.whl.

File metadata

  • Download URL: pywybot-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 51.1 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 42b73dab114da8ce4461a935e15dfa6d7e11665bb94d57e3b5f0a3c389c0949b
MD5 e650e661328ce525a27049ba13b48e4f
BLAKE2b-256 4a70148914d8ba8990c84c12138dc20ee00260732c4fa60c9d82ef7976b312de

See more details on using hashes here.

Provenance

The following attestation bundles were made for pywybot-1.1.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