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:
HeatControlApiClientcan manage its ownaiohttpsession. In that case, either useasync with HeatControlApiClient(...)or callawait client.close().HeatControlConnection.subscribe()registers callbacks for live websocket events and returns an unsubscribe function.- Discovery helpers cover both the
/api/pingdiscoverypayload and Zeroconf TXT-record property normalization.
License
Licensed under the GNU Lesser General Public License v3.0 or later (LGPL-3.0-or-later). See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file upgrait_heatcontrol_api-0.2.0.tar.gz.
File metadata
- Download URL: upgrait_heatcontrol_api-0.2.0.tar.gz
- Upload date:
- Size: 26.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e0490fe83f4b06bb5aa6907898cd04d16c1417e4b1a7c41efa9f52dc46140c2
|
|
| MD5 |
a292cab24245dd7d13934dcdf5c4cfae
|
|
| BLAKE2b-256 |
42b49c51e41d0ddc9bbc51f21213e6f511ce06b1c9941ce1d08310a4d623c52f
|
Provenance
The following attestation bundles were made for upgrait_heatcontrol_api-0.2.0.tar.gz:
Publisher:
publish-pypi.yml on UPGRAITgmbh/upgrait-heatcontrol-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
upgrait_heatcontrol_api-0.2.0.tar.gz -
Subject digest:
6e0490fe83f4b06bb5aa6907898cd04d16c1417e4b1a7c41efa9f52dc46140c2 - Sigstore transparency entry: 2171777645
- Sigstore integration time:
-
Permalink:
UPGRAITgmbh/upgrait-heatcontrol-api@0b832145a5a582b303a5c7dce17b42298be07114 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/UPGRAITgmbh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@0b832145a5a582b303a5c7dce17b42298be07114 -
Trigger Event:
release
-
Statement type:
File details
Details for the file upgrait_heatcontrol_api-0.2.0-py3-none-any.whl.
File metadata
- Download URL: upgrait_heatcontrol_api-0.2.0-py3-none-any.whl
- Upload date:
- Size: 25.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2f15ed4ae01826b47d66b58dc3a09f441dfa373fd185f3ab2ae4a9b1885ca1d
|
|
| MD5 |
8ff6637cdbf8e10ff3679f9a1ff97819
|
|
| BLAKE2b-256 |
e7b40a01ee37a3dd48cdc5310b7393b08e90871b3a0f01c919d657b9869387fa
|
Provenance
The following attestation bundles were made for upgrait_heatcontrol_api-0.2.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on UPGRAITgmbh/upgrait-heatcontrol-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
upgrait_heatcontrol_api-0.2.0-py3-none-any.whl -
Subject digest:
e2f15ed4ae01826b47d66b58dc3a09f441dfa373fd185f3ab2ae4a9b1885ca1d - Sigstore transparency entry: 2171777660
- Sigstore integration time:
-
Permalink:
UPGRAITgmbh/upgrait-heatcontrol-api@0b832145a5a582b303a5c7dce17b42298be07114 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/UPGRAITgmbh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@0b832145a5a582b303a5c7dce17b42298be07114 -
Trigger Event:
release
-
Statement type: