mirror of
https://github.com/jpawlowski/hass.tibber_prices.git
synced 2026-03-29 21:03:40 +00:00
Best Price min_distance now uses negative values (-50 to 0) to match semantic meaning "below average". Peak Price continues using positive values (0 to 50) for "above average". Uniform formula: avg * (1 + distance/100) works for both period types. Sign indicates direction: negative = toward MIN (cheap), positive = toward MAX (expensive). Changes: - const.py: DEFAULT_BEST_PRICE_MIN_DISTANCE_FROM_AVG = -5 (was 5) - schemas.py: Best Price range -50 to 0, Peak Price range 0 to 50 - validators.py: Separate validate_best_price_distance_percentage() - level_filtering.py: Simplified to uniform formula (removed conditionals) - translations: Separate error messages for Best/Peak distance validation - tests: 37 comprehensive validator tests (100% coverage) Impact: Configuration UI now visually represents direction relative to average. Users see intuitive negative values for "below average" pricing. |
||
|---|---|---|
| .. | ||
| api | ||
| binary_sensor | ||
| config_flow_handlers | ||
| coordinator | ||
| custom_translations | ||
| entity_utils | ||
| sensor | ||
| services | ||
| translations | ||
| utils | ||
| __init__.py | ||
| config_flow.py | ||
| const.py | ||
| data.py | ||
| diagnostics.py | ||
| entity.py | ||
| manifest.json | ||
| services.yaml | ||