hass.tibber_prices/custom_components/tibber_prices/services
Julian Pawlowski 2f36c73c18 feat(services): add hourly resolution option for chart data services
Add resolution parameter to get_chartdata and get_apexcharts_yaml services,
allowing users to choose between original 15-minute intervals or aggregated
hourly values for chart visualization.

Implementation uses rolling 5-interval window aggregation (-2, -1, 0, +1, +2
around :00 of each hour = 60 minutes total), matching the sensor rolling
hour methodology. Respects user's CONF_AVERAGE_SENSOR_DISPLAY setting for
mean vs median calculation.

Changes:
- formatters.py: Add aggregate_to_hourly() function preserving original
  field names (startsAt, total, level, rating_level) for unified processing
- get_chartdata.py: Pre-aggregate data before processing when resolution is
  'hourly', enabling same code path for filters/insert_nulls/connect_segments
- get_apexcharts_yaml.py: Add resolution parameter, pass to all 4 get_chartdata
  service calls in generated JavaScript
- services.yaml: Add resolution field with interval/hourly selector
- icons.json: Add section icons for get_apexcharts_yaml fields
- translations: Add highlight_peak_price and resolution field translations
  for all 5 languages (en, de, sv, nb, nl)

Impact: Users can now generate cleaner charts with 24 hourly data points
instead of 96 quarter-hourly intervals. The unified processing approach
ensures all chart features (filters, null insertion, segment connection)
work identically for both resolutions.
2026-01-20 15:51:34 +00:00
..
__init__.py feat(services): add debug_clear_tomorrow for testing refresh cycle 2025-12-23 14:13:51 +00:00
debug_clear_tomorrow.py feat(services): add debug_clear_tomorrow for testing refresh cycle 2025-12-23 14:13:51 +00:00
formatters.py feat(services): add hourly resolution option for chart data services 2026-01-20 15:51:34 +00:00
get_apexcharts_yaml.py feat(services): add hourly resolution option for chart data services 2026-01-20 15:51:34 +00:00
get_chartdata.py feat(services): add hourly resolution option for chart data services 2026-01-20 15:51:34 +00:00
get_price.py fix(coordinator): track API calls separately from cached data usage 2025-12-25 18:53:29 +00:00
helpers.py feat(services): add rolling 48h window support to chart services 2025-12-01 23:46:09 +00:00
refresh_user_data.py refactor(services): split monolithic services.py into package 2025-11-18 20:07:05 +00:00