A Python client library for interacting with the Haven Lighting API.
pip install havenlighting
from havenlighting import HavenClient
# Initialize the client
client = HavenClient()
# Authenticate
authenticated = client.authenticate(
email="[email protected]",
password="your-password"
)
if authenticated:
# Discover locations
locations = client.discover_locations()
# Print available locations and lights
for location_id, location in locations.items():
print(f"Location: {location.name}")
# Get lights for this location
lights = location.get_lights()
# Control lights
for light_id, light in lights.items():
print(f"Light: {light.name}")
light.turn_on() # Turn light on
light.turn_off() # Turn light off
- Clone the repository
- Copy .env.example to .env and fill in your credentials:
cp .env.example .env
- Install development dependencies:
pip install -e ".[dev]"
- Run tests:
pytest
MIT License - see LICENSE file for details.