Thanks for your interest in contributing! Here's how to get started.
- Python 3.12+
- Node.js 20+
- A Home Assistant instance for testing
python -m venv .venv
source .venv/bin/activate
pip install pytest pytest-asyncio homeassistant voluptuouscd frontend
npm install
npm run dev # Dev server with hot reload
npm run build # Production build (TypeScript check + Vite bundle)The production build outputs to custom_components/roommind/frontend/roommind-panel.js.
# All tests
.venv/bin/pytest tests/ -v
# Single test file
.venv/bin/pytest tests/test_store.py -v
# Single test
.venv/bin/pytest tests/test_coordinator.py::test_heating_mode -vTests are organized by module:
tests/
coordinator/ # Coordinator logic tests
control/ # MPC, thermal model, solar tests
managers/ # Manager-specific tests
services/ # Analytics service tests
utils/ # Utility function tests
integration/ # Multi-cycle integration tests
Coverage must stay ≥ 95% (enforced in CI). Check locally:
.venv/bin/pytest tests/ --cov=custom_components/roommind --cov-report=term-missing- Async-first (
async_prefix for async methods) - Type hints on all function signatures
voluptuousfor WebSocket API validation_LOGGERfor logging (neverprint())
@customElementdecorator for web components@propertyfor HA-bound properties,@statefor internal state- HA CSS custom properties only (e.g.
--primary-color) — never hardcode colors - Use HA built-in components (
ha-card,ha-button,ha-select, etc.)
All user-facing strings go through localize(). Add new keys to both frontend/src/locales/en.json and de.json.
Use short, one-line messages with a type prefix:
feat: add room display name aliases
fix: round humidity display to one decimal
refactor: extract schedule resolution logic
docs: update installation instructions
chore: update dependencies
- Fork the repo and create a feature branch from
main - Make your changes
- Ensure all tests pass and frontend builds cleanly
- Submit a PR with a clear description of what and why
Use GitHub Issues with the provided templates for bug reports and feature requests.