hass.tibber_prices/custom_components/tibber_prices/config_flow.py
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

52 lines
1.4 KiB
Python

"""
Config flow for Tibber Prices integration.
This module serves as the entry point for Home Assistant's config flow discovery.
The actual implementation is in the config_flow_handlers package.
"""
from __future__ import annotations
from .config_flow_handlers.options_flow import (
TibberPricesOptionsFlowHandler as OptionsFlowHandler,
)
from .config_flow_handlers.schemas import (
get_best_price_schema,
get_options_init_schema,
get_peak_price_schema,
get_price_rating_schema,
get_price_trend_schema,
get_reauth_confirm_schema,
get_select_home_schema,
get_subentry_init_schema,
get_user_schema,
get_volatility_schema,
)
from .config_flow_handlers.subentry_flow import (
TibberPricesSubentryFlowHandler as SubentryFlowHandler,
)
from .config_flow_handlers.user_flow import TibberPricesFlowHandler as ConfigFlow
from .config_flow_handlers.validators import (
CannotConnectError,
InvalidAuthError,
validate_api_token,
)
__all__ = [
"CannotConnectError",
"ConfigFlow",
"InvalidAuthError",
"OptionsFlowHandler",
"SubentryFlowHandler",
"get_best_price_schema",
"get_options_init_schema",
"get_peak_price_schema",
"get_price_rating_schema",
"get_price_trend_schema",
"get_reauth_confirm_schema",
"get_select_home_schema",
"get_subentry_init_schema",
"get_user_schema",
"get_volatility_schema",
"validate_api_token",
]