mirror of
https://github.com/jpawlowski/hass.tibber_prices.git
synced 2026-03-30 13:23:41 +00:00
Volatility Threshold Optimization: - Replaced global MIN/MAX_VOLATILITY_THRESHOLD (0-100%) with six separate constants for overlapping ranges per threshold level - MODERATE: 5.0-25.0% (was: 0-100%) - HIGH: 20.0-40.0% (was: 0-100%) - VERY_HIGH: 35.0-80.0% (was: 0-100%) - Added detailed comments explaining ranges and cascading requirements Validators: - Added three specific validation functions (one per threshold level) - Added cross-validation ensuring MODERATE < HIGH < VERY_HIGH - Added fallback to existing option values for completeness check - Updated error keys to specific messages per threshold level UI Improvements: - Changed NumberSelector mode: BOX → SLIDER (consistency with other config steps) - Changed step size: 0.1% → 1.0% (better UX, sufficient precision) - Updated min/max ranges to match new validation constants Translations: - Removed: "invalid_volatility_threshold" (generic) - Added: "invalid_volatility_threshold_moderate/high/very_high" (specific ranges) - Added: "invalid_volatility_thresholds" (cross-validation error) - Updated all 5 languages (de, en, nb, nl, sv) Files modified: - config_flow_handlers/options_flow.py: Updated validation logic - config_flow_handlers/schemas.py: Updated NumberSelector configs - config_flow_handlers/validators.py: Added specific validators + cross-validation - const.py: Replaced global constants with six specific constants - translations/*.json: Updated error messages (5 languages) Impact: Users get clearer validation errors with specific ranges shown, better UX with sliders and appropriate step size, and guaranteed threshold ordering (MODERATE < HIGH < VERY_HIGH). |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| options_flow.py | ||
| schemas.py | ||
| subentry_flow.py | ||
| user_flow.py | ||
| validators.py | ||