diff --git a/custom_components/tibber_prices/coordinator/period_handlers/relaxation.py b/custom_components/tibber_prices/coordinator/period_handlers/relaxation.py index 41c7aa5..2a73448 100644 --- a/custom_components/tibber_prices/coordinator/period_handlers/relaxation.py +++ b/custom_components/tibber_prices/coordinator/period_handlers/relaxation.py @@ -3,6 +3,7 @@ from __future__ import annotations import logging +from datetime import timedelta from typing import TYPE_CHECKING, Any if TYPE_CHECKING: @@ -216,7 +217,9 @@ def group_periods_by_day(periods: list[dict]) -> dict[date, list[dict]]: current_date = start_date while current_date <= end_date: periods_by_day.setdefault(current_date, []).append(period) - # Move to next day + current_date = current_date + timedelta(days=1) + + return periods_by_day def mark_periods_with_relaxation(