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.

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.1.tar.gz (14.3 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.1-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pybluetti-0.1.1.tar.gz
  • Upload date:
  • Size: 14.3 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.1.tar.gz
Algorithm Hash digest
SHA256 624c69af88298753438580488ac8f22e686c534e3ecf363030dfa8385b499efa
MD5 665b35cc6bb8bdd7c01ceb07a4601130
BLAKE2b-256 00619a54b492f1ee3deccc21e76cece7e7785eb2a112805d7986c7d12223cf8c

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on bluetti-community/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.1-py3-none-any.whl.

File metadata

  • Download URL: pybluetti-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.6 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d9ce195892f0157beb0cec9d39240cd5ea694be928f235e8e99c3f084835791e
MD5 b0750e1c951f648271942a0c34facb99
BLAKE2b-256 37ec03cd8f6edd115b30303e8a0a0200b077a25046bd9d2706cc738f31c40db1

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on bluetti-community/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

This release

0.1.1 This release

2 files

0.1.0

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