hass.tibber_prices/tests
Julian Pawlowski 9a6eb44382 refactor(config): use negative values for Best Price min_distance
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.
2025-11-22 04:44:57 +00:00
..
__init__.py test: add pytest framework and midnight-crossing tests 2025-11-21 23:47:01 +00:00
test_cache_age.py fix(coordinator): use coordinator update timestamp for cache validity 2025-11-22 04:44:22 +00:00
test_cache_validity.py fix(coordinator): use coordinator update timestamp for cache validity 2025-11-22 04:44:22 +00:00
test_cache_validity_after_midnight.py fix(coordinator): use coordinator update timestamp for cache validity 2025-11-22 04:44:22 +00:00
test_chart_data_push_updates.py feat(sensors): add lifecycle callback for chart_data_export sensor 2025-11-22 04:44:38 +00:00
test_config_validators.py refactor(config): use negative values for Best Price min_distance 2025-11-22 04:44:57 +00:00
test_midnight_periods.py test: add pytest framework and midnight-crossing tests 2025-11-21 23:47:01 +00:00
test_midnight_turnover.py refactor(config): use negative values for Best Price min_distance 2025-11-22 04:44:57 +00:00