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.

Estrutura do Projeto

Certifique-se de que a estrutura do seu projeto está correta:

redgtech-api/ ├── redgtech_api/ │ ├── init .py │ ├── api.py ├── tests/ │ ├── init .py │ ├── test_api.py ├── setup.py ├── README.md ├── LICENSE ├── venv/

Implementação do Pacote

redgtech_api/__init__.py

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.0.tar.gz (2.2 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.0-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: redgtech_api-0.1.0.tar.gz
  • Upload date:
  • Size: 2.2 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.0.tar.gz
Algorithm Hash digest
SHA256 9488fb2fe295511b50e7972b0a62fcc01d24d9c091bdacf1d46d67611b0cad9d
MD5 8b3cddc62f637cf43c90df58b4b11aa6
BLAKE2b-256 145d8014229a22ab333d6190623618e5044e24ed2205dfa9c7cec8e582e57ba9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: redgtech_api-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.5 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4b5ddeba45c4bdecbfc372f71382690f6215643b0b9986e132a4817b9e338ae4
MD5 c38858b18f140a47430c9f8811cd86f8
BLAKE2b-256 6e36d413e4cf68ba0ab00bd002cb56e4da8e5713a7974f7304ecb89b613ef5f8

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