hass.tibber_prices/custom_components/tibber_prices
Julian Pawlowski 8975aef900 fix(interval_pool): preserve DST fall-back duplicate intervals
On DST fall-back nights the clocks repeat an hour (e.g. 02:00 CET/CEST).
Tibber delivers quarter-hourly intervals for both the CEST (+02:00) and
CET (+01:00) copies of that hour.  Both share the same 19-char naive local
key 'YYYY-MM-DDTHH:MM:SS', so _add_intervals treated the CET arrivals as
unwanted duplicates and sent them to _touch_intervals, which kept the CEST
data and silently discarded the CET price data.  The fall-back hour's prices
were permanently lost from the pool.

Fix:
- Add module constant _DST_COLLISION_MAX_SAME_UTC_S (60 s) to distinguish
  true duplicate arrivals (same UTC, ≤60 s apart) from DST collision pairs
  (~3600 s apart).
- Add _handle_index_collision() helper that compares the UTC datetimes of
  the existing and incoming interval.  If they differ by more than the
  threshold it stores the new interval in self._dst_extras keyed by the
  normalised local timestamp and returns True.
- _add_intervals delegates every collision to _handle_index_collision and
  only routes to touch when it returns False (true duplicate).
- _get_cached_intervals yields the saved extras after the main interval.
- After each GC run, stale entries are pruned from _dst_extras.
- to_dict / from_dict persist and restore _dst_extras across HA restarts.

Impact: The full fall-back hour (e.g. 02:00-02:45 CET) now appears in the
interval pool alongside the CEST copies, so sensors that query that hour
return correct prices instead of stale or missing data.
2026-04-06 14:05:10 +00:00
..
api fix(api): handle None values in API responses to prevent AttributeError 2025-12-13 14:02:30 +00:00
binary_sensor refactor(entities): remove redundant name= from all entity descriptions 2026-04-06 13:16:07 +00:00
config_flow_handlers fix(translations): update API token instructions to use placeholder for Tibber URL 2026-03-29 18:19:42 +00:00
coordinator fix(coordinator): preserve currency and home_id in re-transform calls 2026-04-06 13:51:59 +00:00
custom_translations feat(config_flow): show override warnings when config entities control settings 2026-01-21 17:36:51 +00:00
entity_utils fix(sensor): best price calculation on v-shaped days 2026-04-06 11:13:09 +00:00
interval_pool fix(interval_pool): preserve DST fall-back duplicate intervals 2026-04-06 14:05:10 +00:00
number refactor(entities): remove redundant name= from all entity descriptions 2026-04-06 13:16:07 +00:00
sensor refactor(entities): remove redundant name= from all entity descriptions 2026-04-06 13:16:07 +00:00
services fix(sensor): best price calculation on v-shaped days 2026-04-06 11:13:09 +00:00
switch refactor(entities): remove redundant name= from all entity descriptions 2026-04-06 13:16:07 +00:00
translations fix(translations): update API token instructions to use placeholder for Tibber URL 2026-03-29 18:19:42 +00:00
utils feat(sensors): add 5-level price trend scale with configurable thresholds 2026-01-20 13:36:01 +00:00
__init__.py feat(config_flow): show override warnings when config entities control settings 2026-01-21 17:36:51 +00:00
config_flow.py feat(config_flow): add price level gap tolerance for Tibber API level field 2025-12-22 20:25:30 +00:00
const.py feat(sensors): add 5-level price trend scale with configurable thresholds 2026-01-20 13:36:01 +00:00
data.py feat(interval-pool): add intelligent interval caching and memory optimization 2025-11-25 20:44:39 +00:00
diagnostics.py refactor(lifecycle): integrate with Pool for sensor metrics 2025-12-23 14:13:34 +00:00
entity.py fix(sensor): best price calculation on v-shaped days 2026-04-06 11:13:09 +00:00
icons.json feat(services): add hourly resolution option for chart data services 2026-01-20 15:51:34 +00:00
manifest.json chore(release): bump version to 0.27.0 2026-03-29 18:49:21 +00:00
services.yaml feat(services): add hourly resolution option for chart data services 2026-01-20 15:51:34 +00:00