hass.tibber_prices/custom_components/tibber_prices/sensor
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
..
attributes fix(coordinator): use coordinator update timestamp for cache validity 2025-11-22 04:44:22 +00:00
calculators fix(coordinator): use coordinator update timestamp for cache validity 2025-11-22 04:44:22 +00:00
__init__.py fix(imports): update imports after utils package reorganization 2025-11-18 20:07:28 +00:00
chart_data.py feat(chart_export): migrate sensor config from UI to configuration.yaml 2025-11-20 13:41:26 +00:00
core.py feat(sensor): add data lifecycle diagnostic sensor with push updates 2025-11-20 15:12:41 +00:00
definitions.py feat(sensor): add data lifecycle diagnostic sensor with push updates 2025-11-20 15:12:41 +00:00
helpers.py refactor(naming): complete class naming convention alignment 2025-11-20 11:22:53 +00:00
value_getters.py feat(sensor): add data lifecycle diagnostic sensor with push updates 2025-11-20 15:12:41 +00:00