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.33.tar.gz (3.3 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.33-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: redgtech_api-0.1.33.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for redgtech_api-0.1.33.tar.gz
Algorithm Hash digest
SHA256 204f88c389d32a172f1a70f8ad926adabcdea5210b6db38718184d0f7f298180
MD5 9dc7e9b436050ebad3d57e0c586e73b2
BLAKE2b-256 4b2f16dec9e3526a2a4298225f80ca63bea28b3070bc5501e62cc5153aa635d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for redgtech_api-0.1.33.tar.gz:

Publisher: publish.yml on redgtech-automacao/redgtech-python-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

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

File hashes

Hashes for redgtech_api-0.1.33-py3-none-any.whl
Algorithm Hash digest
SHA256 5e022decda9f14c990a98408a33de8f1a2766414a530dcc3db21c8fde61ebd4b
MD5 4decf85791cd46124314d509f2cf0a31
BLAKE2b-256 5f1406b21de5872ef6703ca2c0eda96764d006ebc933e5cf48dfcbda8dcb71e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for redgtech_api-0.1.33-py3-none-any.whl:

Publisher: publish.yml on redgtech-automacao/redgtech-python-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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