Skip to main content

pymacon

Secure async REST and WebSocket client for the Macon Heat Pump Controller. It is the transport library used by the Macon Home Assistant integration.

Each MaconClient owns the credential, pinned certificate, ordered state, reconnect loop, and reconciliation state for exactly one controller. Multiple controllers therefore remain fully isolated.

Install

pip install pymacon

Usage

from pymacon import MaconClient

client = MaconClient(
    "192.168.1.21",
    token,
    certificate_fingerprint,
    # arctic-* is retained because it is the firmware wire-format ID.
    device_id="arctic-001122334455",
)
client.subscribe(handle_snapshot)
client.subscribe_status(handle_status)
await client.start()

Call await client.stop() when unloading the owning config entry. Sessions passed into the constructor remain owned by the caller; sessions created by the client are closed automatically.

Control methods acknowledge that a command was accepted, but they never optimistically mutate local state. Subscribe to snapshots to observe the controller's reported state:

await client.async_set_cooling_setpoint(12)
await client.async_set_power(False)

Only controls advertised by client.capabilities should be called. The firmware rejects unavailable, unsafe, or unsupported operations.

Controller health (uptime, reset reason, brownout/panic/watchdog counts, Wi-Fi drop and RS485 bus counters) is polled separately from the heat-pump state when client.capabilities.diagnostics is true. Every health field is optional. diagnostics.events carries the controller's newest problem events (Wi-Fi and network outages, crashes and resets) as ControllerEvents; use event.key to tell new ones from ones already seen. A restart names the current boot so a late retry cannot reboot the controller twice:

diagnostics = await client.async_fetch_diagnostics()
if client.capabilities.restart:
    await client.async_restart()

Development

python -m pip install -e ".[tests]"
pytest
ruff check src tests
mypy src

Metadata

Release files for pymacon 0.5.5

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

Source distribution (sdist)

Source distribution for pymacon 0.5.5
File Size Uploaded Provenance Actions
pymacon-0.5.5.tar.gz 27.2 kB With provenance Details for pymacon-0.5.5.tar.gz

Built distribution (wheel)

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

Total release size: 47.5 kB

Release files / pymacon-0.5.5.tar.gz

Download URL pymacon-0.5.5.tar.gz
Size 27.2 kB
Tags Source
SHA-256 checksum
How to use checksums
16bd9406197560944d23ac7e995e491c32a6a0e18cd79827d9fef988ed265aca
BLAKE2b-256 checksum
How to use checksums
91aa84fc7953f0c046e9fc54dadfe3d4eea896e1f5c75963924ccef9f574a215
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 Oct 18, 2026.

Transparency log

Release files / pymacon-0.5.5-py3-none-any.whl

Download URL pymacon-0.5.5-py3-none-any.whl
Size 20.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ca8abea912c9306b99e229833d6fd3d7d59766d20966fa9ff6e17027b2331688
BLAKE2b-256 checksum
How to use checksums
348e5c977dd17d3112578e5022dd26de8eccecca1d533d3cf5f828fb7e9fd7b1
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 Oct 18, 2026.

Transparency log

Security for pymacon 0.5.5

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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pymacon-0.5.5.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 Oct 18, 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