mirror of
https://github.com/jpawlowski/hass.tibber_prices.git
synced 2026-05-28 18:43:40 +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". |
||
|---|---|---|
| .. | ||
| services | ||
| __init__.py | ||
| test_avg_none_fallback.py | ||
| test_best_price_e2e.py | ||
| test_config_validators.py | ||
| test_coordinator_shutdown.py | ||
| test_interval_pool_memory_leak.py | ||
| test_interval_pool_optimization.py | ||
| test_level_filtering.py | ||
| test_lifecycle_state.py | ||
| test_mean_median_display.py | ||
| test_midnight_handler.py | ||
| test_midnight_periods.py | ||
| test_midnight_turnover.py | ||
| test_minmax_none_fallback.py | ||
| test_next_api_poll.py | ||
| test_peak_price_e2e.py | ||
| test_percentage_calculations.py | ||
| test_period_calculation.py | ||
| test_price_calculations.py | ||
| test_rating_threshold_validation.py | ||
| test_resource_cleanup.py | ||
| test_sensor_consistency.py | ||
| test_sensor_timer_assignment.py | ||
| test_time_service.py | ||
| test_timer_scheduling.py | ||
| test_tomorrow_data_refresh.py | ||
| test_user_data_validation.py | ||