hass.tibber_prices/custom_components/tibber_prices/interval_pool
Julian Pawlowski ce049e48b1 fix(interval_pool): use UTC-aware gap detection to prevent spring-forward false positives
_get_sensor_interval_stats() computed expected_count via UTC time
arithmetic ((end - start).total_seconds() / 900 = 480 for 5 days), then
iterated through fixed-offset local timestamps adding timedelta(minutes=15).

On DST spring-forward days (e.g. last Sunday March in EU), clocks skip
from 02:00 to 03:00. The 4 local quarter-hour slots 02:00-02:45 never
exist, so the Tibber API never returns intervals for them. The iteration
still visits those 4 keys, finds them absent from the index, and reports
has_gaps=True (expected=480, actual=476). Since no API call can ever
fill those non-existent slots, the pool triggers an unnecessary gap-fill
fetch every 15 minutes for the entire spring-forward day.

Fix: keep the nominal expected_count for diagnostics, but determine
has_gaps via the new _has_real_gaps_in_range() helper that sorts
cached intervals by UTC time and checks consecutive UTC differences.
The 01:45+01:00 -> 03:00+02:00 transition is exactly 15 minutes in
UTC, so no gap is reported. Start/end boundary comparisons use naive
19-char local timestamps to stay consistent with the fixed-offset
arithmetic used by get_protected_range().

Impact: No spurious API fetches on DST spring-forward Sunday. Gap
detection for real missing data (API failures, first startup) remains
fully functional.
2026-04-06 13:57:03 +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(interval_pool): use UTC-aware gap detection to prevent spring-forward false positives 2026-04-06 13:57:03 +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