From 7fd81c79e1c64b515cc420dbc1f6035989a8f0a4 Mon Sep 17 00:00:00 2001 From: 5ila5 <5ila5@users.noreply.github.com> Date: Tue, 27 Feb 2024 20:08:08 +0100 Subject: [PATCH] heilbronn_de fix duplicate bug --- .../waste_collection_schedule/source/heilbronn_de.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/waste_collection_schedule/waste_collection_schedule/source/heilbronn_de.py b/custom_components/waste_collection_schedule/waste_collection_schedule/source/heilbronn_de.py index 5b1dca7c..0b0a5a68 100644 --- a/custom_components/waste_collection_schedule/waste_collection_schedule/source/heilbronn_de.py +++ b/custom_components/waste_collection_schedule/waste_collection_schedule/source/heilbronn_de.py @@ -78,9 +78,9 @@ class Source: districts: dict = street[self._hausnr] # filter waste type - collection_keys = [ + collection_keys = { value for key, value in districts.items() if key not in ("city", "district") - ] + } r = requests.get( "https://api.heilbronn.de/garbage-calendar?method=get&datatype=pickupdates" @@ -94,7 +94,7 @@ class Source: value = pickupDates["data"][valueDistrict] for collection_type, collection_dates in value.items(): for value2 in collection_dates.values(): - date: dict = datetime.strptime(value2, "%Y-%m-%d").date() + date = datetime.strptime(value2, "%Y-%m-%d").date() entry = collection_type icon = ICON_MAP.get(entry.split("_")[0].lower()) entries.append(Collection(date, entry, icon))