mirror of
https://github.com/jpawlowski/hass.tibber_prices.git
synced 2026-03-29 21:03:40 +00:00
Implemented comprehensive metadata calculation for chart data export service with automatic Y-axis scaling and gradient positioning based on actual price statistics. Changes: - Added 'metadata' parameter to get_chartdata service (include/only/none) - Implemented _calculate_metadata() with per-day price statistics * min/max/avg/median prices * avg_position and median_position (0-1 scale for gradient stops) * yaxis_suggested bounds (floor(min)-1, ceil(max)+1) * time_range with day boundaries * currency info with symbol and unit - Integrated metadata into rolling_window modes via config-template-card * Pre-calculated yaxis bounds (no async issues in templates) * Dynamic gradient stops based on avg_position * Server-side calculation ensures consistency Visual refinements: - Best price overlay opacity reduced to 0.05 (ultra-subtle green hint) - Stroke width increased to 1.5 for better visibility - Gradient opacity adjusted to 0.45 with "light" shade - Marker configuration: size 0, hover size 2, strokeWidth 1 - Header display: Only show LOW/HIGH rating_levels (min/max prices) * Conditional logic excludes NORMAL and level types * Entity state shows meaningful extrema values - NOW marker label removed for rolling_window_autozoom mode * Static position at 120min lookback makes label misleading Code cleanup: - Removed redundant all_series_config (server-side data formatting) - Currency names capitalized (Cents, Øre, Öre, Pence) Translation updates: - Added metadata selector translations (de, en, nb, nl, sv) - Added metadata field description in services - Synchronized all language files Impact: Users get dynamic Y-axis scaling based on actual price data, eliminating manual configuration. Rolling window charts automatically adjust axis bounds and gradient positioning. Header shows only meaningful extreme values (daily min/max). All data transformation happens server-side for optimal performance and consistency. |
||
|---|---|---|
| .. | ||
| de.json | ||
| en.json | ||
| nb.json | ||
| nl.json | ||
| sv.json | ||