Skip to content

Development Setup

Set up your development environment for HAEO.

Prerequisites

  • Python 3.13+
  • uv package manager
  • Git

Installation

Clone repository

git clone https://github.com/hass-energy/haeo.git
cd haeo

Install dependencies

uv sync

This installs all development dependencies including:

  • pytest (testing)
  • ruff (linting/formatting)
  • pyright (type checking)
  • zensical (documentation)

Local Home Assistant simulation

For interactive development with realistic input data and a browsable frontend:

uv run sim scenario1

See the local simulation guide for options including accelerated time, ephemeral mode, and skipping automatic HAEO setup.

Running tests

# Unit tests, as the test gate runs them
uv run check test

# Everything, including scenario, guide, and benchmark tests
uv run pytest

# Model element tests
uv run pytest custom_components/haeo/core/model/tests/

# With coverage
uv run pytest --cov=custom_components.haeo

Code quality

Linting

uv run ruff check

Formatting

uv run ruff format

Type checking

uv run pyright

Documentation

Build locally

uv run zensical serve

Visit http://127.0.0.1:8000

uv run zensical build is the documentation gate in uv run check. It runs in strict mode, so a broken internal link or anchor fails it.

Deploy

Documentation automatically deploys via GitHub Actions on push to main.

Next steps