Skip to content

Set up a Development Environment

A docker-compose.yml is provided to spin up a test Home Assistant instance with the component pre-installed.

  1. Copy the environment template:
    cp docker/.env.sample docker/.env
    
  2. Edit docker/.env and set your MQTT broker address and port. ebusd needs to be running and publishing already; it's not included in this setup.
  3. Start the container:
    docker compose up -d
    
  4. Access Home Assistant at http://localhost:8123 and log in with test / test.
  5. You should find devices in the integration.

Pre-commit

This repository uses pre-commit to run linting, formatting, and consistency checks.

Install the hooks:

uv tool install pre-commit --with pre-commit-uv
pre-commit install

Once installed, checks run automatically on every git commit. You can also run them manually:

pre-commit run --all-files

Running tests

Tests use pytest with pytest-homeassistant-custom-component.

Run all tests:

uv run pytest

Or run a specific test file:

uv run pytest tests/test_climate.py -v