hass.tibber_prices/custom_components/tibber_prices/interval_pool
Julian Pawlowski 23b4330b9a fix(coordinator): track API calls separately from cached data usage
The lifecycle sensor was always showing "fresh" state because
_last_price_update was set on every coordinator update, regardless of
whether data came from API or cache.

Changes:
- interval_pool/manager.py: get_intervals() and get_sensor_data() now
  return tuple[data, bool] where bool indicates actual API call
- coordinator/price_data_manager.py: All fetch methods propagate
  api_called flag through the call chain
- coordinator/core.py: Only update _last_price_update when api_called=True,
  added debug logging to distinguish API calls from cached data
- services/get_price.py: Updated to handle new tuple return type

Impact: Lifecycle sensor now correctly shows "cached" during normal
15-minute updates (using pool cache) and only "fresh" within 5 minutes
of actual API calls. This fixes the issue where the sensor would never
leave the "fresh" state during frequent HA restarts or normal operation.
2025-12-25 18:53:29 +00:00
..
__init__.py feat(interval-pool): add intelligent interval caching and memory optimization 2025-11-25 20:44:39 +00:00
cache.py fix(interval_pool): prevent external mutation of cached intervals 2025-12-23 14:13:24 +00:00
fetcher.py fix(interval_pool): prevent external mutation of cached intervals 2025-12-23 14:13:24 +00:00
garbage_collector.py fix(interval_pool): prevent external mutation of cached intervals 2025-12-23 14:13:24 +00:00
index.py refactor(interval_pool): improve reliability and test coverage 2025-12-23 10:10:35 +00:00
manager.py fix(coordinator): track API calls separately from cached data usage 2025-12-25 18:53:29 +00:00
routing.py feat(interval-pool): add intelligent interval caching and memory optimization 2025-11-25 20:44:39 +00:00
storage.py feat(interval-pool): add intelligent interval caching and memory optimization 2025-11-25 20:44:39 +00:00