mirror of
https://github.com/jpawlowski/hass.tibber_prices.git
synced 2026-07-28 01:26:49 +00:00
_cleanup_dead_intervals() compacts group["intervals"] in-place after removing dead (touched) intervals. Surviving intervals shift to new positions, but the timestamp index was not updated to reflect this. _remove_empty_groups() only rebuilds the index when groups become completely empty. For partially-compacted groups (some dead intervals removed but group still has living intervals), no rebuild happened. This left stale interval_index values that point past the end of the compacted list, causing IndexError in _get_cached_intervals. Fix: after _remove_empty_groups, if dead intervals were cleaned but no groups became empty, explicitly rebuild the index so positions reflect the compacted group["intervals"] lists. Adds regression test reproducing the exact partial-touch scenario that triggers stale index entries after in-place compaction. Fixes #118 Impact: Brand-new Tibber users can now set up the integration without getting "Failed setup, will retry: list index out of range". |
||
|---|---|---|
| .. | ||
| api | ||
| binary_sensor | ||
| brand | ||
| config_flow_handlers | ||
| coordinator | ||
| custom_translations | ||
| entity_utils | ||
| interval_pool | ||
| number | ||
| sensor | ||
| services | ||
| switch | ||
| translations | ||
| utils | ||
| __init__.py | ||
| config_flow.py | ||
| const.py | ||
| data.py | ||
| diagnostics.py | ||
| entity.py | ||
| icons.json | ||
| manifest.json | ||
| services.yaml | ||