Thank you for your interest in contributing! This document provides guidelines and information for contributors.
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/ha-light-controller.git - Create a feature branch from
testing:git checkout -b feature/your-feature-name testing - Make your changes
- Push to your fork:
git push origin feature/your-feature-name - Open a Pull Request against the
testingbranch (notmain)
- Python 3.13+
- UV package manager
curl -LsSf https://astral.sh/uv/install.sh | shgit clone https://github.com/L3DigitalNet/ha-light-controller.git
cd ha-light-controller
uv venv .venv # Create virtual environment
source .venv/bin/activate # Activate it
make setup # Install dependencies + pre-commit hooksmake test # Run all tests
make test-cov # Run tests with coverage report
pytest tests/test_controller.py # Run a specific test fileTests mock the homeassistant module — no running Home Assistant instance is needed.
make lint # Ruff linter
make lint-fix # Lint with auto-fix
make format # Ruff formatter
make type-check # mypy type checker
make quality # All checks at once
make ci # Full CI simulation- One concern per PR. Keep changes focused and reviewable.
- Write descriptive commit messages. Explain what changed and why.
- Update CHANGELOG.md for all non-trivial changes.
- Add tests for new functionality.
- Ensure all checks pass before requesting review:
make ci
This is a Home Assistant integration. All contributions must follow HA's async requirements:
- Never use blocking I/O — no
time.sleep(), syncrequests, or blocking file operations - All I/O must be async — use
await, orhass.async_add_executor_job()for unavoidable sync calls - Use HA APIs —
hass.services.async_call,hass.states.get, etc. Never bypass the state machine
This project uses Ruff for linting and formatting, and mypy for type checking.
- Run
make formatto auto-format code - Run
make lintto check for issues (ormake lint-fixto auto-fix) - Run
make type-checkto verify types — all new code must pass with 0 errors - Use modern Python type hints (
list[str],X | None— notList,Optional) - Prefer flat over nested — if nesting exceeds 3 levels, extract a helper
- Use the issue tracker to report bugs
- Check existing issues before creating a new one
- Use the issue templates when available
- Include steps to reproduce for bug reports
Please do not open public issues for security vulnerabilities. See SECURITY.md for responsible disclosure instructions.
By contributing, you agree that your contributions will be licensed under the same MIT License as the project.
Feel free to open a GitHub Discussion or an issue if you have questions about contributing.