Quick Start¶
This guide will help you get started with Busylight Core quickly.
Installation¶
First, install busylight_core using pip:
Or with uv:
Basic Usage¶
After installing busylight_core, you can start controlling lights in your Python code:
from busylight_core import Light
# Find all connected lights
lights = Light.available()
print(f"Found {len(lights)} device(s)")
# Control the first light found
if lights:
light = lights[0]
light.on((255, 0, 0)) # Turn on red
light.off() # Turn off
Discovering Your Device¶
Check what lights are connected to your system:
from busylight_core import Light
# Get all available lights
lights = Light.available()
for i, light in enumerate(lights):
print(f"Light {i}: {light.vendor} {light.name}")
print(f" Device ID: {light.device_id}")
print(f" Connection: {light.hardware.device_type}")
Basic Light Control¶
Colors¶
Control your light with RGB colors:
from busylight_core import Light
light = Light.first_light() # Get the first available light
# Basic colors (RGB tuples)
light.on((255, 0, 0)) # Red
light.on((0, 255, 0)) # Green
light.on((0, 0, 255)) # Blue
light.on((255, 255, 0)) # Yellow
light.on((255, 0, 255)) # Magenta
light.on((0, 255, 255)) # Cyan
light.on((255, 255, 255)) # White
# Turn off
light.off()
Flash Patterns¶
Create attention-getting flash patterns:
light.flash((255, 0, 0), count=3) # Flash red 3 times
light.flash((0, 255, 0), duration=0.5) # Flash green with custom timing
Configuration¶
Busylight Core can be configured using environment variables or a configuration file. See Configuration for details.
Examples¶
For more detailed examples including async usage, multi-device control, and advanced features, see the Examples page.
Next Steps¶
- Learn about Advanced Features
- Check out the API Reference
- Read the Contributing Guide if you want to contribute