mirror of
https://github.com/jpawlowski/hass.tibber_prices.git
synced 2026-03-29 21:03:40 +00:00
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. |
||
|---|---|---|
| .. | ||
| api | ||
| binary_sensor | ||
| config_flow_handlers | ||
| coordinator | ||
| custom_translations | ||
| entity_utils | ||
| interval_pool | ||
| sensor | ||
| services | ||
| translations | ||
| utils | ||
| __init__.py | ||
| config_flow.py | ||
| const.py | ||
| data.py | ||
| diagnostics.py | ||
| entity.py | ||
| icons.json | ||
| manifest.json | ||
| services.yaml | ||