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.4.tar.gz (3.6 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.4-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for redgtech_api-0.1.4.tar.gz
Algorithm Hash digest
SHA256 7b98d45caf1926cbdda5e3ff82305c847b5cf92319dc1ea88de496a57a46b7dd
MD5 af7e2d4941a0f854885bb41f2045223f
BLAKE2b-256 6fa30de3e9bfb8fb2aedf1524dbd9a24b1d3de8cf189bead62b1dcbe0bf0d228

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for redgtech_api-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2ccc7e0f7e9c47ab09a919738f869e456e57bf10b53052605e29414dfb2fbea7
MD5 d6078a32fe5f67ad743327a3400501f8
BLAKE2b-256 8e2229a22fbaff2d02c2286df0f8a3e28fea9f38d29a0a737380201fb9760158

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