mirror of
https://github.com/jpawlowski/hass.tibber_prices.git
synced 2026-04-07 08:03:40 +00:00
_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. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| cache.py | ||
| fetcher.py | ||
| garbage_collector.py | ||
| index.py | ||
| manager.py | ||
| routing.py | ||
| storage.py | ||