Redgtech API
A Python package to interact with the Redgtech API.
Installation
You can install the package using pip:
pip install redgtech-api
Usage
Here is an example of how to use the package:
import asyncio
from redgtech_api import RedgtechAPI
asyncdefmain():
api = RedgtechAPI("your_access_token")
data = await api.get_data()
print(data)
await api.close()
asyncio.run(main())
API Methods
get_data()
Fetches data from the Redgtech API.
Example
data = await api.get_data()
print(data)
set_switch_state(endpoint_id, state)
Sets the state of a switch.
Parameters
endpoint_id(str): The ID of the switch endpoint.state(bool): The desired state of the switch (True for on, False for off).
Example
success = await api.set_switch_state("endpoint_id", True)
print(success)
set_light_brightness(endpoint_id, brightness)
Sets the brightness of a light.
Parameters
endpoint_id(str): The ID of the light endpoint.brightness(int): The desired brightness level (0-255).
Example
success = await api.set_light_brightness("endpoint_id", 128)
print(success)
License
This project is licensed under the MIT License.
Project Structure
Ensure your project structure is correct:
redgtech-api/ ├── redgtech_api/ │ ├── init.py │ ├── api.py ├── tests/ │ ├── init.py │ ├── test_api.py ├── setup.py ├── README.md ├── LICENSE ├── venv/
Package Implementation
from .api import RedgtechAPI
Metadata
Release files for redgtech-api 0.1.38
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| redgtech_api-0.1.38.tar.gz | 4.0 kB | Without provenance | Details for redgtech_api-0.1.38.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| redgtech_api-0.1.38-py3-none-any.whl | Python 3 | none | any | Details for redgtech_api-0.1.38-py3-none-any.whl |
Total release size: 8.6 kB
Release files / redgtech_api-0.1.38.tar.gz
| Download URL | redgtech_api-0.1.38.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7fb94f12a0f3cbc63991ffe121facded85de0e4cd483e84f882f621977d814df
|
|
BLAKE2b-256 checksum How to use checksums |
beb2d27dcbcbc94f938adad9fdf34c2f09d3f34ffde52fd42915cc3788503446
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.2
|
Release files / redgtech_api-0.1.38-py3-none-any.whl
| Download URL | redgtech_api-0.1.38-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fedaf063a05e6f7c71ad2e4c0c627f3d3150945edb8536ae7aef53493170c5a0
|
|
BLAKE2b-256 checksum How to use checksums |
70b7a7de236063519cb300c3c25d06b954fd8ad4e719ec7dd35f1296cdde3f63
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.2
|
Security for redgtech-api 0.1.38
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.