mirror of
https://github.com/jpawlowski/hass.tibber_prices.git
synced 2026-03-30 05:13:40 +00:00
Problem: In segmented price charts with connect_segments=true, vertical lines at price level transitions were always drawn by the ending segment. This meant a price INCREASE showed a cheap-colored line going UP, and a price DECREASE showed an expensive-colored line going DOWN - counterintuitive for users. Solution: Implement directional bridge-point logic using price level hierarchy: - Add _is_transition_to_more_expensive() helper using PRICE_LEVEL_MAPPING and PRICE_RATING_MAPPING to determine transition direction - Price INCREASE (cheap → expensive): The MORE EXPENSIVE segment draws the vertical line UP via new start-bridge logic (end-bridge at segment start) - Price DECREASE (expensive → cheap): The MORE EXPENSIVE segment draws the vertical line DOWN via existing end-bridge logic (bridge at segment end) Technical changes: - Track prev_value and prev_price for segment start detection - Add end-bridge points at segment starts for upward transitions - Replace unconditional bridge points with directional hold/bridge logic - Hold points extend segment horizontally when next segment handles transition Impact: Vertical transition lines now consistently use the color of the more expensive price level, making price movements more visually intuitive. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| formatters.py | ||
| get_apexcharts_yaml.py | ||
| get_chartdata.py | ||
| get_price.py | ||
| helpers.py | ||
| refresh_user_data.py | ||