Skip to content

Latest commit

 

History

History
84 lines (61 loc) · 1.46 KB

File metadata and controls

84 lines (61 loc) · 1.46 KB

Contributing to Smart Irrigation

Development Setup

Prerequisites

Quick Start

  1. Clone the repository

    git clone <repository-url>
    cd HAsmartirrigation
  2. Create and activate virtual environment

    python3 -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install development dependencies

    pip install --upgrade pip
    pip install -r requirements-dev.txt
  4. Set up environment variables (for testing)

    cp .env.example .env
    # Edit .env with your API keys

Running Tests

# Run all tests
pytest

Code Quality

We use several tools to maintain code quality:

# Format code
black .

# Sort imports
isort .

# Lint code
flake8 .

# Type checking
mypy custom_components/smart_irrigation/

Pre-commit Hooks

Install pre-commit hooks to automatically run checks:

pre-commit install

Deactivating Environment

When you're done developing:

deactivate

Project Structure

  • custom_components/smart_irrigation/ - Main component code
  • tests/ - Unit tests
  • test_*.py - Integration test scripts
  • requirements-dev.txt - Development dependencies
  • requirements.test.txt - Testing dependencies