mirror of
https://github.com/jpawlowski/hass.tibber_prices.git
synced 2026-03-30 21:33:39 +00:00
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.
57 lines
1.2 KiB
Markdown
57 lines
1.2 KiB
Markdown
# Development Setup
|
|
|
|
> **Note:** This guide is under construction. For now, please refer to [`AGENTS.md`](../../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
|
|
|
|
```bash
|
|
# 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
|
|
|
|
```bash
|
|
# Start Home Assistant in debug mode
|
|
./scripts/develop
|
|
```
|
|
|
|
Visit http://localhost:8123
|
|
|
|
## Making Changes
|
|
|
|
```bash
|
|
# Lint and format code
|
|
./scripts/lint
|
|
|
|
# Check-only (CI mode)
|
|
./scripts/lint-check
|
|
|
|
# Validate integration structure
|
|
./scripts/hassfest
|
|
```
|
|
|
|
See [`AGENTS.md`](../../AGENTS.md) for detailed patterns and conventions.
|