Skip to main content

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

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)

Source distribution for redgtech-api 0.1.38
File Size Uploaded
redgtech_api-0.1.38.tar.gz 4.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for redgtech-api 0.1.38
File Interpreter ABI Platform
redgtech_api-0.1.38-py3-none-any.whl Python 3 none any Details

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
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