mirror of
https://github.com/jpawlowski/hass.tibber_prices.git
synced 2026-07-27 17:26:48 +00:00
When include_current_interval=False, the search_start was set to the raw now timestamp (e.g. 14:47:00.167996). The interval pool index iterates in 15-minute steps from that exact value, so keys like 14:47:00, 15:02:00, … never matched any cached interval (which are always on :00/:15/:30/:45 boundaries), causing no data to be found and returning no_data_in_range. Fix: replace `now` with `ceil_to_next_quarter_hour(now)` which is always `floor(now) + 15min`. This skips the interval that is currently in progress (14:30–14:45 interval) and starts at the first interval that hasn't begun yet (15:00), consistent with the intent of include_current_interval=False. Fixes #190 User-Impact: find_cheapest_block/find_most_expensive_block/find_cheapest_hours with include_current_interval=false and search_scope=next_24h (or no scope) no longer returns no_data_in_range when data is available. Agent-Logs-Url: https://github.com/jpawlowski/hass.tibber_prices/sessions/0ea804f9-7c98-4e5a-b40f-469954fa9daa Co-authored-by: jpawlowski <75446+jpawlowski@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| services | ||
| __init__.py | ||
| test_avg_none_fallback.py | ||
| test_best_price_e2e.py | ||
| test_binary_sensor_period_attributes.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_negative_best_price_periods.py | ||
| test_next_api_poll.py | ||
| test_peak_price_e2e.py | ||
| test_percentage_calculations.py | ||
| test_period_calculation.py | ||
| test_period_overlap.py | ||
| test_period_statistics.py | ||
| test_periods_hash.py | ||
| test_price_calculations.py | ||
| test_price_window.py | ||
| test_rating_threshold_validation.py | ||
| test_relaxation.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 | ||