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.0.0.tar.gz (74.0 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.0.0-py3-none-any.whl (50.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pywybot-1.0.0.tar.gz
Algorithm Hash digest
SHA256 81c92e63169590610c6465b01630949ad1e2461475534a7ef15160781e16afdc
MD5 6571c7506f85e0505cab5c53777e2f90
BLAKE2b-256 15d1f63c2b800d64c51159bcccb166d6f72e78f93644962f879954edf31f6e02

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pywybot-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 50.7 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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 66f7ea223f060af3b7557302a841b911c6a6ffdb71309242aefcc20c03a3d7a6
MD5 96677de66854ff0330d5ee89823c7cf7
BLAKE2b-256 e9c55c884f4d1a17059176772a2ebd9eeae7dd6a426f4123dbd8d76b0653946c

See more details on using hashes here.

Provenance

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