mirror of
https://github.com/jpawlowski/hass.tibber_prices.git
synced 2026-03-29 21:03:40 +00:00
Restored mark_periods_with_relaxation() function and added call in relax_all_prices() to properly mark periods found through relaxation. Problem: Periods found via relaxation were missing metadata attributes: - relaxation_active - relaxation_level - relaxation_threshold_original_% - relaxation_threshold_applied_% These attributes are expected by: - period_overlap.py: For merging periods with correct relaxation info - binary_sensor/attributes.py: For displaying relaxation info to users Implementation: - Added reverse_sort parameter to preserve sign semantics - For Best Price: Store positive thresholds (e.g., +15%, +18%) - For Peak Price: Store negative thresholds (e.g., -20%, -23%) - Mark periods immediately after calculate_periods() and before resolve_period_overlaps() so metadata is preserved during merging Impact: Users can now see which periods were found through relaxation and at what flex threshold. Peak Price periods show negative thresholds matching the user's configuration semantics (negative = below maximum). |
||
|---|---|---|
| .. | ||
| 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 | ||