hass.tibber_prices/custom_components/tibber_prices/sensor/attributes
Julian Pawlowski 49866f26fa fix(coordinator): use coordinator update timestamp for cache validity
Cache validity now checks _last_coordinator_update (within 30min)
instead of _api_calls_today counter. Fixes false "stale" status
when coordinator runs every 15min but cache validation was only
checking API call counter.

Bug #1: Cache validity shows "stale" at 05:57 AM
Bug #2: Cache age calculation incorrect after midnight turnover
Bug #3: get_cache_validity inconsistent with cache_age sensor

Changes:
- Coordinator: Use _last_coordinator_update for cache validation
- Lifecycle: Extract cache validation to dedicated helper function
- Tests: 7 new tests covering midnight scenarios and edge cases

Impact: Cache validity sensor now accurately reflects coordinator
activity, not just explicit API calls. Correctly handles midnight
turnover without false "stale" status.
2025-11-22 04:44:22 +00:00
..
__init__.py feat(sensor): add data lifecycle diagnostic sensor with push updates 2025-11-20 15:12:41 +00:00
daily_stat.py refactor(naming): complete class naming convention alignment 2025-11-20 11:22:53 +00:00
future.py feat(sensor): add data lifecycle diagnostic sensor with push updates 2025-11-20 15:12:41 +00:00
interval.py refactor(naming): complete class naming convention alignment 2025-11-20 11:22:53 +00:00
lifecycle.py fix(coordinator): use coordinator update timestamp for cache validity 2025-11-22 04:44:22 +00:00
metadata.py refactor(naming): complete class naming convention alignment 2025-11-20 11:22:53 +00:00
timing.py refactor(naming): complete class naming convention alignment 2025-11-20 11:22:53 +00:00
trend.py refactor(naming): complete class naming convention alignment 2025-11-20 11:22:53 +00:00
volatility.py refactor(naming): complete class naming convention alignment 2025-11-20 11:22:53 +00:00
window_24h.py refactor(naming): complete class naming convention alignment 2025-11-20 11:22:53 +00:00