Skip to main content

utec-client

Fork notice: This is an independently maintained fork of LF2b2w/utec-py, the original repository by @LF2b2w. The upstream project currently appears to be unmaintained, so this fork exists to keep the library working alongside the companion Uhome-HA integration. It is not vendor-official. Any changes made here will be offered back to the upstream repository should it become responsive again. See MIGRATION.md if you are coming from utec_py — the import name changed.

Python API client for U-Tec/U-Home devices. Primarily for Home Assistant, but usable anywhere.

Install

pip install utec-client

Imports use the utec_client namespace:

from utec_client.api import UHomeApi
from utec_client.auth import AbstractAuth
from utec_client.devices.lock import Lock
from utec_client.devices.light import Light
from utec_client.devices.sensor import Sensor
from utec_client.devices.switch import Switch
from utec_client.exceptions import ApiError

API overview

UHomeApi (utec_client.api)

U-Tec's API is a single endpoint (https://api.utec.com/action) that uses variable header information in the JSON payload to reach different API interfaces. UHomeApi handles packaging the variables responsible for the different interfaces/actions correctly within the request payload.

AbstractAuth (utec_client.auth)

Abstract base class handling most of the OAuth2 process: generating the auth request URL, token exchange, token management, expiry validation, and token refresh. Subclass it and implement the abstract token-retrieval method to control how the initial auth request is handled. UHomeApi uses an AbstractAuth implementation to perform authenticated requests.

Device modules (utec_client.devices)

Device info is organized with minimal change from the raw API response (id, name, category, handleType, deviceInfo, capabilities, customData, attributes, state). Device type classes (Light, Lock, Sensor, Switch) pre-format and pre-fill API requests for simple integration downstream. Locks are the most fully supported device type; switches and lights have limited functionality.

Development

Requires Python 3.11–3.14.

pip install -e .[dev]
ruff check . && ruff format --check .
pytest                # includes the 90% branch-coverage floor

See docs/RELEASES.md for the release process and MIGRATION.md for the utec_py → utec_client rename guide.

License

MIT. Upstream authorship (Luke Wallis) is preserved; see LICENSE.

Metadata

Release files for utec-client 0.5.0

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

Source distribution (sdist)

Source distribution for utec-client 0.5.0
File Size Uploaded
utec_client-0.5.0.tar.gz 64.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for utec-client 0.5.0
File Interpreter ABI Platform
utec_client-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 80.1 kB

Release files / utec_client-0.5.0.tar.gz

Download URL utec_client-0.5.0.tar.gz
Size 64.9 kB
Tags Source
SHA-256 checksum
How to use checksums
80f04a8a99a1a401f6c6761ec75d52c0ad58c206e3929d05fa8b3d77cf29e3c5
BLAKE2b-256 checksum
How to use checksums
e5dddcc0ff99e50105893f706cc5a0bbd3edc1d4551b1cfe55ddc8fe1a625c2f
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 3, 2026.

Transparency log

Release files / utec_client-0.5.0-py3-none-any.whl

Download URL utec_client-0.5.0-py3-none-any.whl
Size 15.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c1443203655b3d02a1d5fd715c009b01065a6630d174dc59a7d9940e18dca1fd
BLAKE2b-256 checksum
How to use checksums
9736dab1bf7394fee5e6a55d327366cab9cfcfae480928d098a222e5f8aa07b1
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 3, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

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