diff --git a/custom_components/tibber_prices/services.py b/custom_components/tibber_prices/services.py index f99457c..338a760 100644 --- a/custom_components/tibber_prices/services.py +++ b/custom_components/tibber_prices/services.py @@ -379,7 +379,9 @@ def _prepare_day_structures(price_info_data: dict, hourly_ratings: list) -> tupl d: [ r for r in hourly_ratings - if day_prefixes[d] and r.get("time", r.get("startsAt", "")).startswith(day_prefixes[d][0]) + if isinstance(r, dict) + and day_prefixes[d] + and r.get("time", r.get("startsAt", "")).startswith(day_prefixes[d][0]) ] if price_info_by_day[d] and day_prefixes[d] else []