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.dev0",
        )
        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.dev0.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.dev0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for upgrait_heatcontrol_api-0.1.0.dev0.tar.gz
Algorithm Hash digest
SHA256 16f1342cfd473c17b0c1deab8dbe5ac6f56ac39aabeeafe10973d8799ade76c3
MD5 150299a39fb3ee21afaceadefbef6c10
BLAKE2b-256 37d919803678c1d39743b3d702c1435431122ad7789c7a53d20b0140b08c9b75

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for upgrait_heatcontrol_api-0.1.0.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 796d839592c5b8d04f6296531e3a5266fef8f941e8fe0c778ec57d3dcbd8b7ed
MD5 f1588f74a4e57b9fcf930d294ea4bae0
BLAKE2b-256 8854288606f11a59641523e98a17f30e6a4a4d89c2273135aaa9b3710135fed8

See more details on using hashes here.

Provenance

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