mirror of
https://github.com/jpawlowski/hass.tibber_prices.git
synced 2026-07-27 17:26:48 +00:00
find_cheapest_block, find_cheapest_hours, and find_cheapest_schedule accept an optional power_profile (fixed per-interval watt array matching the requested duration/task length). When allow_relaxation was enabled and no full-duration window could be found, the duration-reduction relaxation phase silently reduced the interval count without shrinking power_profile accordingly. Downstream code (find_cheapest_contiguous_window, calculate_window_statistics, _find_cheapest_window_in_pool) then truncated the profile from the front to match, dropping trailing appliance-cycle phases and using the wrong per-interval weights for both window selection and the reported cost estimate. Disable duration-reduction relaxation whenever a power_profile is supplied (find_cheapest_schedule guards per-task via any_task_has_power_profile); distance and level-filter relaxation phases remain available since they don't affect interval count. Impact: Services with a power_profile no longer silently pick a shorter window with mismatched power weighting during relaxation; they now correctly report no window found if the full duration isn't available, preserving the accuracy of appliance-cycle cost estimates. |
||
|---|---|---|
| .. | ||
| 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 | ||