- Python 3.11 or higher
- Git
- on Windows:
- Microsoft Visual C++ 14.0 or greater # Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
-
Clone the repository
git clone <repository-url> cd HAsmartirrigation
-
Create and activate virtual environment
python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install development dependencies
pip install --upgrade pip pip install -r requirements-dev.txt
-
Set up environment variables (for testing)
cp .env.example .env # Edit .env with your API keys
# Run all tests
pytestWe use several tools to maintain code quality:
# Format code
black .
# Sort imports
isort .
# Lint code
flake8 .
# Type checking
mypy custom_components/smart_irrigation/Install pre-commit hooks to automatically run checks:
pre-commit installWhen you're done developing:
deactivatecustom_components/smart_irrigation/- Main component codetests/- Unit teststest_*.py- Integration test scriptsrequirements-dev.txt- Development dependenciesrequirements.test.txt- Testing dependencies