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
scripts/typecheck  # run mypy --strict

License

MIT - see LICENSE.

Metadata

Release files for pybluetti 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pybluetti 0.3.0
File Size Uploaded Provenance Actions
pybluetti-0.3.0.tar.gz 26.1 kB With provenance Details for pybluetti-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pybluetti 0.3.0
File Interpreter ABI Platform Actions
pybluetti-0.3.0-py3-none-any.whl Python 3 none any Details for pybluetti-0.3.0-py3-none-any.whl

Total release size: 42.2 kB

Release files / pybluetti-0.3.0.tar.gz

Download URL pybluetti-0.3.0.tar.gz
Size 26.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f20e047951acfd2ff39d26868452cc3a685c2bc983b46aff8b9bcd9545f31cf8
BLAKE2b-256 checksum
How to use checksums
d0627f5a9400d0f95330a538aa88f4aca048a87356bf21c31e94e36f357ac1ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Release files / pybluetti-0.3.0-py3-none-any.whl

Download URL pybluetti-0.3.0-py3-none-any.whl
Size 16.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ca482c84b8b721e30e6fbd8ea3795bea327f5bc50f78657251a3f7e99a2aaeef
BLAKE2b-256 checksum
How to use checksums
bc04667319d5bfd6e115a0a2eaefb591a862ceaec6c5ce8f13d9b349c1e60ac0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Security for pybluetti 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pybluetti-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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