Skip to main content

Async Python API client for the UPGRAIT HeatControl 3rd-party connector.

Project description

upgrait-heatcontrol-api

Async Python API package for the UPGRAIT HeatControl 3rd-party connector.

The package is intended to be the external dependency consumed by the Home Assistant integration and by other 3rd-party clients.

Current feature set:

  • HTTP probing via /api/ping
  • device metadata parsing
  • pairing start via /api/pair/start
  • pairing confirmation via /api/pair/confirm
  • websocket bind/session transport
  • encrypted request/response handling over the websocket session
  • initial snapshot handling and live event subscription
  • Zeroconf service constants and discovery metadata parsing helpers

Installation:

pip install upgrait-heatcontrol-api

Example:

import asyncio

from upgrait_heatcontrol_api import HeatControlApiClient, generate_keypair


async def main() -> None:
    async with HeatControlApiClient(host="<device-ip>") as client:
        # Step 1: read device metadata
        device = await client.async_get_device_info()
        print(device.serial, device.version)

        # Step 2: generate a keypair once and persist it for subsequent connections
        private_key, public_key = generate_keypair()

        # Step 3: start pairing — the device will display a 6-digit PIN
        # (requires new local interface, firmware version > 1610)
        pairing = await client.async_start_pairing(
            ha_instance_id="example-ha-instance",
            display_name="Example Client",
            integration_version="0.1.0",
        )
        print(f"PIN expires at: {pairing.expires_at}")

        # Step 4: confirm with the PIN shown on the device
        pin = input("Enter PIN: ")
        confirm = await client.async_confirm_pairing(
            pin=pin,
            ha_instance_id="example-ha-instance",
            display_name="Example Client",
            integration_version="0.1.0",
            ha_public_key=public_key,
        )

        # Step 5: open the persistent websocket connection
        connection = await client.async_connect_and_bind(
            ha_instance_id="example-ha-instance",
            ha_private_key=private_key,
            server_public_key=confirm.server_public_key,
        )
        print("Connected. Snapshot:", connection.snapshot)


asyncio.run(main())

Notes:

  • HeatControlApiClient can manage its own aiohttp session. In that case, either use async with HeatControlApiClient(...) or call await client.close().
  • HeatControlConnection.subscribe() registers callbacks for live websocket events and returns an unsubscribe function.
  • Discovery helpers cover both the /api/ping discovery payload and Zeroconf TXT-record property normalization.

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

upgrait_heatcontrol_api-0.1.1.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

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

upgrait_heatcontrol_api-0.1.1-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: upgrait_heatcontrol_api-0.1.1.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for upgrait_heatcontrol_api-0.1.1.tar.gz
Algorithm Hash digest
SHA256 49bdc8e58e97324158e6163e3c112ddacf2f5a2c1c2f7a4d00caa84574f87e31
MD5 26b4e2a994ea7ab9a80455e102c457a0
BLAKE2b-256 0777027684006d96aca53e6818ffc59c974f98d64b3055185ad0bea0e38808e9

See more details on using hashes here.

Provenance

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

Publisher: publish-pypi.yml on UPGRAITgmbh/upgrait-heatcontrol-api

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

File details

Details for the file upgrait_heatcontrol_api-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for upgrait_heatcontrol_api-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8d0c1c039d212dfa670e8ec9fab5fd8ed03b067f1efd7c7ce250b5aa60cad72d
MD5 9042881d85ec6d18bccd1e7424c9db2b
BLAKE2b-256 95aa42050f410d6d59f1305001e4b65afcfcc14baa87f810d7cff3fc5f9556a3

See more details on using hashes here.

Provenance

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

Publisher: publish-pypi.yml on UPGRAITgmbh/upgrait-heatcontrol-api

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