Skip to main content

pybluetti

Async Python client for the BLUETTI cloud API - device discovery, state, and control.

Status: fully async, not yet wired up or published

This repository is the extraction target for the API client code that used to live in bluetti-home-assistant's custom_components/bluetti/api/, following the same pattern pyenphase uses for the enphase_envoy Home Assistant integration: a standalone, independently testable and versionable library, decoupled from Home Assistant's own release cycle.

The extraction is happening in three steps:

  1. Done. Move the client code here mechanically, decoupled from hass (server URLs and an on_auth_expired callback are passed in as plain constructor arguments instead - see src/pybluetti/).
  2. Done. Replace the blocking websocket-client transport (previously run on a dedicated thread to keep it out of Home Assistant's event loop) with aiohttp's native async websocket client - src/pybluetti/websocket.py has no threads left. STOMP protocol framing (stomper) is unchanged.
  3. Not started. Publish to PyPI, and switch bluetti-home-assistant's manifest.json/imports to depend on this package instead of its own in-tree copy.

Why extract it

  • Independent testing and versioning, not tied to Home Assistant's release cadence.
  • A step toward Home Assistant core inclusion - core integrations are expected to depend on an external library for the actual device/API communication, not embed raw HTTP/websocket calls directly in the integration.
  • Fixed a known gap along the way: the embedded client used to run the blocking websocket-client library on a dedicated thread to keep it out of Home Assistant's event loop. pybluetti is fully async instead, matching bluetti-home-assistant's own quality_scale.yaml async-dependency goal once step 3 wires it up.

Development

scripts/setup   # install runtime + test dependencies
scripts/test    # run the test suite (100% line coverage enforced)
scripts/lint    # run ruff, auto-fixing what it safely can

License

MIT - see LICENSE.

Download files

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

Source Distribution

pybluetti-0.1.0.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

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

pybluetti-0.1.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file pybluetti-0.1.0.tar.gz.

File metadata

  • Download URL: pybluetti-0.1.0.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pybluetti-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ba5ed3a1c8888ecda4084ec4ce8cc31ee81a3b282f896337a4eb0a67211ce707
MD5 031cdc0a2f9420347684f0fb6fc5deff
BLAKE2b-256 345eccf3627d2e049c8f3bbf8391c7c199e5980888b93be783796d0240278e19

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybluetti-0.1.0.tar.gz:

Publisher: publish.yml on chpego/pybluetti

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

File details

Details for the file pybluetti-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pybluetti-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pybluetti-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1f727fb2652113e6690971640ffc8f975f0cb0e81d34f08baedf4a02af36e75c
MD5 752aeaa34b7b7cff2acc4a61ea0772f1
BLAKE2b-256 567a19b64cadf0c7776ee38ddfde008edf041faaef005e8c210c32e4a2aa94d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybluetti-0.1.0-py3-none-any.whl:

Publisher: publish.yml on chpego/pybluetti

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

Release history Release notifications | RSS feed

0.1.1

2 files

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page