mirror of
https://github.com/jpawlowski/hass.tibber_prices.git
synced 2026-03-29 21:03:40 +00:00
Implementation flaw discovered: gradient_stop calculated as `(avg - min) / (max - min)` for combined data produces one value applied to ALL series. Each series (VERY_CHEAP, NORMAL, VERY_EXPENSIVE) has different min/max ranges, so the same gradient stop position represents a different absolute price in each series. Example failure case: - VERY_CHEAP: 10-20 ct → 50% at 15 ct (below overall avg!) - VERY_EXPENSIVE: 40-50 ct → 50% at 45 ct (above overall avg!) Conclusion: Gradient shows middle of each series range, not average price position. Solution: Fixed 50% gradient purely for visual appeal. Semantic information provided by: - Series colors (CHEAP/NORMAL/EXPENSIVE) - Grid lines (implicitly show average) - Dynamic Y-axis bounds (optimal scaling via chart_metadata sensor) Changes: - sensor/chart_metadata.py: Remove gradient_stop extraction - services/get_apexcharts_yaml.py: Fixed gradient at [50, 100] - custom_translations/*.json: Remove gradient_stop references Impact: Honest visualization with no false semantic signals. Feature was never released, clean removal without migration. |
||
|---|---|---|
| .. | ||
| attributes | ||
| calculators | ||
| __init__.py | ||
| chart_data.py | ||
| chart_metadata.py | ||
| core.py | ||
| definitions.py | ||
| helpers.py | ||
| types.py | ||
| value_getters.py | ||