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.
- 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.
- From the Developer Console note the
client_idandclient_secret. - From the Developer Console add a
RedirectUri. For thedump_devicesexample 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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d6e9a0985e91b6bf0b5d271b7f5113d65b000cb4300ecdd1eed628f4bb0eb5e8
|
|
| MD5 |
8261db6c66c0074f18f6134d9d57504b
|
|
| BLAKE2b-256 |
f07226d277b2f2f4c1d01d6534c17f5b9a027df75823d67679ee07025efc0a97
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67083da3145d6de25968687f227db9f1b4e9ae2e3aa4d05f41104a44bc3a09e8
|
|
| MD5 |
44f79cf6d1d7b0b516e62fb5a18f9fd5
|
|
| BLAKE2b-256 |
6409789a895ad68c9ccd4e1188e675c266956014d28b07dc17578f14e7234a25
|