Skip to main content

A Python package to interact with the Redgtech API

Project description

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

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

redgtech_api-0.1.32.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

redgtech_api-0.1.32-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file redgtech_api-0.1.32.tar.gz.

File metadata

  • Download URL: redgtech_api-0.1.32.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for redgtech_api-0.1.32.tar.gz
Algorithm Hash digest
SHA256 902020a1d5dfee690aea0aedadf1d0c3408b37a22fc855614f7733e264b5b623
MD5 5e77f0ddbb5b1eea40a556f6d9e0bd0c
BLAKE2b-256 b3805cb9009f4e865007c2e7c2d2b60ab94a32eacb15c7151a9331e307be2660

See more details on using hashes here.

File details

Details for the file redgtech_api-0.1.32-py3-none-any.whl.

File metadata

  • Download URL: redgtech_api-0.1.32-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for redgtech_api-0.1.32-py3-none-any.whl
Algorithm Hash digest
SHA256 965f40bb1fdd93642aec0e26e074c1fb700b89ec905ac750084eab08af66d1bb
MD5 96b6b9d8b4eabe485f60633c9857e476
BLAKE2b-256 65977bf69947a09921c3d822da19cc66303d03b91452fe4a19fccf6553ece06e

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