hass.tibber_prices/custom_components/tibber_prices
Julian Pawlowski 11d4cbfd09 feat(config_flow): add price level gap tolerance for Tibber API level field
Implement gap tolerance smoothing for Tibber's price level classification
(VERY_CHEAP/CHEAP/NORMAL/EXPENSIVE/VERY_EXPENSIVE), separate from the existing
rating_level gap tolerance (LOW/NORMAL/HIGH).

New feature:
- Add CONF_PRICE_LEVEL_GAP_TOLERANCE config option with separate UI step
- Implement _apply_level_gap_tolerance() using same bidirectional gravitational
  pull algorithm as rating gap tolerance
- Add _build_level_blocks() and _merge_small_level_blocks() helper functions

Config flow changes:
- Add new "price_level" options step with dedicated schema
- Add menu entry "🏷️ Preisniveau" / "🏷️ Price Level"
- Include translations for all 5 languages (de, en, nb, nl, sv)

Bug fixes:
- Use copy.deepcopy() for price intervals before enrichment to prevent
  in-place modification of cached raw API data, which caused gap tolerance
  changes to not take effect when reverting settings
- Clear transformation cache in invalidate_config_cache() to ensure
  re-enrichment with new settings

Logging improvements:
- Reduce options update handler from 4 INFO messages to 1 DEBUG message
- Move level_filtering and period_overlap debug logs to .details logger
  for granular control via configuration.yaml

Technical details:
- level_gap_tolerance is tracked separately in transformation config hash
- Algorithm: Identifies small blocks (≤ tolerance) and merges them into
  the larger neighboring block using gravitational pull calculation
- Default: 1 (smooth single isolated intervals), Range: 0-4

Impact: Users can now stabilize Tibber's price level classification
independently from the internal rating_level calculation. Prevents
automation flickering caused by brief price level changes in Tibber's API.
2025-12-22 20:25:30 +00:00
..
api fix(api): handle None values in API responses to prevent AttributeError 2025-12-13 14:02:30 +00:00
binary_sensor fix: support main and subunit currency 2025-12-11 23:07:06 +00:00
config_flow_handlers feat(config_flow): add price level gap tolerance for Tibber API level field 2025-12-22 20:25:30 +00:00
coordinator feat(config_flow): add price level gap tolerance for Tibber API level field 2025-12-22 20:25:30 +00:00
custom_translations i18n: update translations for average sensor display feature 2025-12-18 15:14:41 +00:00
entity_utils refactor(currency)!: rename major/minor to base/subunit currency terminology 2025-12-11 08:26:30 +00:00
interval_pool feat(interval-pool): add intelligent interval caching and memory optimization 2025-11-25 20:44:39 +00:00
sensor feat(sensors): always show both mean and median in average sensor attributes 2025-12-18 15:12:30 +00:00
services fix(chartdata): assign vertical transition lines to more expensive segment 2025-12-21 17:40:13 +00:00
translations feat(config_flow): add price level gap tolerance for Tibber API level field 2025-12-22 20:25:30 +00:00
utils feat(config_flow): add price level gap tolerance for Tibber API level field 2025-12-22 20:25:30 +00:00
__init__.py fix(config_flow): restructure options flow to menu-based navigation and fix settings persistence 2025-12-13 13:33:31 +00:00
config_flow.py feat(config_flow): add price level gap tolerance for Tibber API level field 2025-12-22 20:25:30 +00:00
const.py feat(config_flow): add price level gap tolerance for Tibber API level field 2025-12-22 20:25:30 +00:00
data.py feat(interval-pool): add intelligent interval caching and memory optimization 2025-11-25 20:44:39 +00:00
diagnostics.py refactor: migrate from multi-home to single-home-per-coordinator architecture 2025-11-24 16:24:37 +00:00
entity.py fix(api): handle None values in API responses to prevent AttributeError 2025-12-13 14:02:30 +00:00
icons.json feat(services): add new services and icons for enhanced functionality and user experience 2025-12-02 18:46:15 +00:00
manifest.json chore(release): bump version to 0.23.1 2025-12-21 10:46:00 +00:00
services.yaml refactor(currency): rename minor_currency to subunit_currency in services.yaml 2025-12-11 09:36:24 +00:00