hass.tibber_prices/docs/development/setup.md
Julian Pawlowski 503075c443 refactor(config_flow): restructure package to satisfy hassfest validation
Home Assistant's hassfest validation requires config flows to be defined
in a file named config_flow.py (not a package directory).

Changes:
- Renamed custom_components/tibber_prices/config_flow/ → config_flow_handlers/
- Created config_flow.py as bridge file re-exporting from config_flow_handlers/
- Updated all import paths across 5 files (user_flow, options_flow, subentry_flow, etc.)
- Added ./scripts/hassfest for local validation (JSON/Python syntax, required files)
- Added ./scripts/clean with three modes (--minimal, normal, --deep)
- Refactored develop/lint/lint-check to use centralized cleanup (DRY principle)
- Updated documentation in AGENTS.md and docs/development/

Technical details:
- Bridge file uses __all__ exports to maintain clean public API
- hassfest script uses ast.parse() for syntax validation (no disk artifacts)
- clean --minimal removes .egg-info only (silent, for automated scripts)
- Dual pip/uv pip compatibility for package uninstallation

Impact: Integration now passes hassfest validation. Local validation available
via ./scripts/hassfest before pushing to GitHub. Cleanup logic centralized and
DRY across all development scripts.
2025-11-15 17:40:53 +00:00

1.2 KiB

Development Setup

Note: This guide is under construction. For now, please refer to AGENTS.md for detailed setup information.

Prerequisites

  • VS Code with Dev Container support
  • Docker installed and running
  • GitHub account (for Tibber API token)

Quick Setup

# Clone the repository
git clone https://github.com/jpawlowski/hass.tibber_prices.git
cd hass.tibber_prices

# Open in VS Code
code .

# Reopen in DevContainer (VS Code will prompt)
# Or manually: Ctrl+Shift+P → "Dev Containers: Reopen in Container"

Development Environment

The DevContainer includes:

  • Python 3.13 with .venv at /home/vscode/.venv/
  • uv package manager (fast, modern Python tooling)
  • Home Assistant development dependencies
  • Ruff linter/formatter
  • Git, GitHub CLI, Node.js, Rust toolchain

Running the Integration

# Start Home Assistant in debug mode
./scripts/develop

Visit http://localhost:8123

Making Changes

# Lint and format code
./scripts/lint

# Check-only (CI mode)
./scripts/lint-check

# Validate integration structure
./scripts/hassfest

See AGENTS.md for detailed patterns and conventions.