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.18.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.18-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for redgtech_api-0.1.18.tar.gz
Algorithm Hash digest
SHA256 d37072d6e3d3e797cb951904dfd4b02b0f5f20a43d2ffac7c2bd11c660ccdbd8
MD5 84b450e9e5c703c0ba8d2fa980aa2c96
BLAKE2b-256 897fdb2c562a2a07ead351429dfeb478f93ae5bfdd3bf48598511ce1234a2ddd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: redgtech_api-0.1.18-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for redgtech_api-0.1.18-py3-none-any.whl
Algorithm Hash digest
SHA256 a85c85ce6e4e2a9fe15bfe13b0e7365daaebe6143c49937fb3b95df3235ada77
MD5 cabf3f84570ca372155087bfefcb312a
BLAKE2b-256 b450badd1faf1c6b112d09f50c356b450c7f64dc34668191660f1c9a52c15515

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