Skip to main content

A python interface for the Uhome OpenAPI

Project description

Uhomepy

Uhomepy is a simple Python API wrapper for the U home OpenAPI. This library provides an abstract base class UhomeOpenAPI to interact with the Uhome API. It includes methods to authenticate and make requests to the API, such as discovering, querying, locking, and unlocking devices.

Configuration

To use the Uhome API, you will need a client_id, a client_secret and a RedirectURI.

[!TIP] Install and set up the U home app before starting the following steps.

  1. Contact U-tec Customer Service to request a Developer Account. Once your Developer Account is set up the Developer Console menu option will show up in you U home app.
  2. From the Developer Console note the client_id and client_secret.
  3. From the Developer Console add a RedirectUri. For the dump_devices example included in this project use any non-public uri (e.g., https://localhost:8080).

Usage

Implementing the UhomeOpenAPI

To use the UhomeOpenAPI, you need to create a concrete implementation of the abstract class which implements the async_get_access_token method.

Example Script

An example script dump_devices.py is provided in the examples directory. This script demonstrates how to use the Uhome API to authenticate a user, retrieve an access token, and dump the list of devices associated with the user.

To run the example script, use the following command:

python examples/dump_devices.py

Limitations

The U home OpenAPI supports SmartLock, SmartPlug, SmartSwitch and Light devices. This library will discover all of these devices types but only supports interacting with SmartLocks.

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

uhomepy-0.9.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

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

uhomepy-0.9.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file uhomepy-0.9.0.tar.gz.

File metadata

  • Download URL: uhomepy-0.9.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for uhomepy-0.9.0.tar.gz
Algorithm Hash digest
SHA256 d6e9a0985e91b6bf0b5d271b7f5113d65b000cb4300ecdd1eed628f4bb0eb5e8
MD5 8261db6c66c0074f18f6134d9d57504b
BLAKE2b-256 f07226d277b2f2f4c1d01d6534c17f5b9a027df75823d67679ee07025efc0a97

See more details on using hashes here.

File details

Details for the file uhomepy-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: uhomepy-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for uhomepy-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 67083da3145d6de25968687f227db9f1b4e9ae2e3aa4d05f41104a44bc3a09e8
MD5 44f79cf6d1d7b0b516e62fb5a18f9fd5
BLAKE2b-256 6409789a895ad68c9ccd4e1188e675c266956014d28b07dc17578f14e7234a25

See more details on using hashes here.

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