Skip to main content

A Python client for SignalRGB

Project description

🌈 signalrgb-python

CI/CD License PyPI version

A powerful Python client library and CLI for controlling SignalRGB Pro

FeaturesInstallationUsageAPI ReferenceDevelopmentContributingLicense

✨ Features

  • 📋 List available lighting effects
  • 🔍 Get detailed information about specific effects
  • 🎨 Apply effects to your devices with ease
  • 🔆 Control brightness levels
  • 🔌 Enable or disable the canvas
  • 🖥️ User-friendly command-line interface
  • 🐍 Python client library for seamless integration into your projects
  • 🔐 Error handling and connection management
  • 🔄 Automatic effect caching for improved performance

💻 Installation

You can install signalrgb-python using pip:

pip install signalrgb

Or if you prefer to use Poetry:

poetry add signalrgb

Prerequisites

This library uses the SignalRGB REST API, which is only available in SignalRGB Pro.

🚀 Usage

Command-line Interface

signalrgb-python comes with an intuitive command-line interface for easy interaction with your SignalRGB setup.

# List all available effects
signalrgb list-effects

# Get details of a specific effect
signalrgb get-effect "Psychedelic Dream"

# Apply an effect
signalrgb apply-effect "Rave Visualizer"

# Get the current effect
signalrgb current-effect

# Set brightness level (0-100)
signalrgb brightness 75

# Get current brightness level
signalrgb brightness

# Enable the canvas
signalrgb enable

# Disable the canvas
signalrgb disable

You can also specify a custom host and port:

signalrgb --host hyperia.home --port 16038 list-effects

For a full list of available commands and options, use:

signalrgb --help

Python Library

Integrate signalrgb-python into your own Python projects with ease:

from signalrgb.client import SignalRGBClient

# Initialize the client
client = SignalRGBClient(host="hyperia.home", port=16038)

# List all effects
effects = client.get_effects()
for effect in effects:
    print(f"Effect: {effect.attributes.name}")

# Apply an effect
client.apply_effect_by_name("Rain")

# Get current effect
current_effect = client.get_current_effect()
print(f"Current effect: {current_effect.attributes.name}")

# Control brightness
client.brightness = 50
print(f"Current brightness: {client.brightness}")

# Enable/disable the canvas
client.enabled = True
print(f"Canvas enabled: {client.enabled}")

Error Handling

The client provides custom exceptions for different types of errors:

from signalrgb.client import SignalRGBClient, ConnectionError, APIError, EffectNotFoundError

client = SignalRGBClient()

try:
    client.apply_effect_by_name("Non-existent Effect")
except ConnectionError as e:
    print(f"Connection failed: {e}")
except EffectNotFoundError as e:
    print(f"Effect not found: {e}")
except APIError as e:
    print(f"API error occurred: {e}")

📘 API Reference

For detailed information about the available methods and classes, please refer to our API Documentation.

🛠️ Development

To set up the development environment:

  1. Clone the repository:
    git clone https://github.com/hyperb1iss/signalrgb-python.git
    cd signalrgb-python
    
  2. Install Poetry if you haven't already: pip install poetry
  3. Install dependencies: poetry install
  4. Activate the virtual environment: poetry shell

To run tests:

pytest

Check out our Development Guide for more information!

👥 Contributing

Have a fix or new feature that you want to add? That's amazing! You're amazing!

  1. Fork the repository
  2. Create a new branch: git checkout -b feature-branch-name
  3. Make your changes and commit them: git commit -m 'Add some feature'
  4. Push to the branch: git push origin feature-branch-name
  5. Submit a pull request

Please make sure to update tests as appropriate and adhere to the project's coding standards.

📄 License

This project is licensed under the Apache License 2.0. See the LICENSE file for details.


📚 Documentation • 🐛 Report Bug • 💡 Request Feature

🙏 Acknowledgements

This project is not officially associated with SignalRGB. It's an independent client library created by the community for the community. Please do not report issues related to this client to the SignalRGB team.


Created by Stefanie Jane 🌠

If you find this project useful, consider buying me a Monster Ultra Violet!! ⚡️

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

signalrgb-0.9.7.tar.gz (15.7 kB view details)

Uploaded Source

Built Distribution

signalrgb-0.9.7-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file signalrgb-0.9.7.tar.gz.

File metadata

  • Download URL: signalrgb-0.9.7.tar.gz
  • Upload date:
  • Size: 15.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Linux/6.5.0-1025-azure

File hashes

Hashes for signalrgb-0.9.7.tar.gz
Algorithm Hash digest
SHA256 1b863518a5bca22937beec17061b55bd0b6c5ee1c2e2f0416591088e729ad0e0
MD5 42f5c2b18e150dd10b479af94b310f00
BLAKE2b-256 aac242c4cb8c48521ce40d32a35f72fe3b5b51939500cc83d106f3549d5b4247

See more details on using hashes here.

File details

Details for the file signalrgb-0.9.7-py3-none-any.whl.

File metadata

  • Download URL: signalrgb-0.9.7-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Linux/6.5.0-1025-azure

File hashes

Hashes for signalrgb-0.9.7-py3-none-any.whl
Algorithm Hash digest
SHA256 179da9c97fd57498d8b6d67ebf4b58ddc6e7c29a4a5e747dc86ba809f040c61f
MD5 878271ab75e694183c8fcef53314056e
BLAKE2b-256 74a2c641d579b47952395419f4b31c066965aa77b8e74f8960dcccffa1b75ba1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page