A Python client library for interacting with the Haven Lighting API.
pip install havenlightingfromhavenlightingimportHavenClient# Initialize the clientclient=HavenClient()
# Authenticateauthenticated=client.authenticate(
email="your-email@example.com",
password="your-password"
)
ifauthenticated:
# Discover locationslocations=client.discover_locations()
# Print available locations and lightsforlocation_id, locationinlocations.items():
print(f"Location: {location.name}")
# Get lights for this locationlights=location.get_lights()
# Control lightsforlight_id, lightinlights.items():
print(f"Light: {light.name}")
light.turn_on() # Turn light onlight.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:
pytestMIT License - see LICENSE file for details.