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="192.168.2.116", port=8001) as client:
        device = await client.async_get_device_info()
        print(device.serial, device.version)

        private_key, public_key = generate_keypair()

        pairing = await client.async_start_pairing(
            ha_instance_id="example-ha-instance",
            display_name="Example Client",
            integration_version="0.1.0",
        )
        print(pairing.expires_at)

        # The 6-digit PIN must be entered by the user after it is shown on the UHC. (Only available in new local interface, version >1610)
        # confirm = await client.async_confirm_pairing(...)
        # connection = await client.async_connect_and_bind(...)


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

Uploaded Python 3

File details

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

File metadata

  • Download URL: upgrait_heatcontrol_api-0.1.0.tar.gz
  • Upload date:
  • Size: 10.4 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.0.tar.gz
Algorithm Hash digest
SHA256 9d6d8303078140680b76b7ff0b6853f761458136fdb65b5478f070909fcd1eef
MD5 0663411b21d934a8d1cbb38a9b2a7bc4
BLAKE2b-256 0d13af8b01a32db40981c63e8788ee187326403b4b5706cfc93748f8cc6f5740

See more details on using hashes here.

Provenance

The following attestation bundles were made for upgrait_heatcontrol_api-0.1.0.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.0-py3-none-any.whl.

File metadata

File hashes

Hashes for upgrait_heatcontrol_api-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 45c70d2ae2085fb7197f6c23d3607c7934efcd69cb19e1ed494cf3b87fc3cec5
MD5 6b42ead3a362a62f34cf2452668d08d6
BLAKE2b-256 4a390f860932dd8796564fa931a8d28470649b8d9e4d74bb8e790822a7804c79

See more details on using hashes here.

Provenance

The following attestation bundles were made for upgrait_heatcontrol_api-0.1.0-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