prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  fixing abki_de recycling
  fix for #891
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `custom_components/waste_collection_schedule/waste_collection_schedule/source/abki_de.py`
  Content:
  ```
  1 import requests
  2 from waste_collection_schedule import Collection  # type: ignore[attr-defined]
  3 from waste_collection_schedule.service.ICS import ICS
  4 
  5 from datetime import datetime
  6 import logging
  7 
  8 TITLE = "Abfallwirtschaftsbetrieb Kiel (ABK)"
  9 DESCRIPTION = "Source for Abfallwirtschaftsbetrieb Kiel (ABK)."
  10 URL = "https://abki.de/"
  11 TEST_CASES = {
  12     "auguste-viktoria-straße, 14": {"street": "auguste-viktoria-straße", "number": 14},
  13     "Achterwehrer Straße, 1 A": {"street": "Achterwehrer Straße", "number": "1 a"},
  14     "Boltenhagener Straße, 4-8": {"street": "Boltenhagener Straße", "number": "4-8"},
  15 }
  16 
  17 
  18 ICON_MAP = {
  19     "Restabfall": "mdi:trash-can",
  20     "Glass": "mdi:bottle-soda",
  21     "Bioabfall": "mdi:leaf",
  22     "Papier": "mdi:package-variant",
  23     "Gelbe": "mdi:recycle",
  24 }
  25 
  26 
  27 ICAL_URL = "https://abki.de/abki-services/abki-leerungen-ical"
  28 _LOGGER = logging.getLogger(__name__)
  29 
  30 
  31 class Source:
  32     def __init__(self, street: str, number: str | int):
  33         self._street: str = street
  34         self._number: str = str(number)
  35         self._ics = ICS()
  36 
  37     def fetch(self):
  38         now = datetime.now()
  39         session = requests.Session()
  40 
  41         # get street id
  42         params = f'filter[logic]=and&filter[filters][0][value]={self._street}&filter[filters][0][field]=Strasse&filter[filters][0][operator]=startswith&filter[filters][0][ignoreCase]=true'
  43         r = session.get(
  44             "https://abki.de/abki-services/strassennamen", params=params)  # , params=params)
  45         r.raise_for_status()
  46 
  47         streets = r.json()
  48         if len(streets) > 1:
  49             _LOGGER.warning(
  50                 "Multiple streets found please be more specific, using first one: "+streets[0]["Strasse"])
  51         if len(streets) < 1:
  52             raise ValueError("No street found", self._street)
  53 
  54         street_id = streets[0]["IDSTREET"]
  55 
  56         # get number id
  57         r = session.get("https://abki.de/abki-services/streetnumber",
  58                         params={"IDSTREET": street_id})
  59         r.raise_for_status()
  60         numbers = r.json()
  61         number_id, standort_id = None, None
  62         for number in numbers:
  63             if number["NUMBER"].lower().replace(" ", "").replace("-", "") == self._number.lower().replace(" ", "").replace("-", ""):
  64                 number_id = number["id"]
  65                 standort_id = number["IDSTANDORT"]
  66                 break
  67         
  68         if number_id is None:
  69             raise ValueError("No number found", self._number)
  70 
  71         # get ics file link
  72         r = session.get("https://abki.de/abki-services/leerungen-data", params={
  73             "Zeitraum": now.year,
  74             "Strasse_input": self._street,
  75             "Strasse": street_id,
  76             "IDSTANDORT_input": 2,
  77             "IDSTANDORT": standort_id,
  78             "Hausnummernwahl": number_id
  79         })
  80         r.raise_for_status()
  81         request_data = r.json()["dataFile"]
  82 
  83         # get ICS file
  84         r = session.get(ICAL_URL, params={"data": request_data})
  85 
  86         dates = self._ics.convert(r.text)
  87 
  88         # if december, also try to get next year
  89         if now.month == 12:
  90             try:
  91                 r = session.get("https://abki.de/abki-services/leerungen-data", params={
  92                     "Zeitraum": now.year+1,
  93                     "Strasse_input": "Aarhusstraße",
  94                     "Strasse": street_id,
  95                     "IDSTANDORT_input": 2,
  96                     "IDSTANDORT": standort_id,
  97                     "Hausnummernwahl": number_id
  98                 })
  99                 r.raise_for_status()
  100                 request_data = r.json()["dataFile"]
  101                 r = session.get(ICAL_URL, params={"data": request_data})
  102                 dates += self._ics.convert(r.text)
  103             except:
  104                 pass
  105 
  106         entries = []
  107         for d in dates:
  108             entries.append(Collection(
  109                 d[0], d[1], ICON_MAP.get(d[1].split(" ")[0])))
  110 
  111         return entries
  112
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/custom_components/waste_collection_schedule/waste_collection_schedule/source/abki_de.py b/custom_components/waste_collection_schedule/waste_collection_schedule/source/abki_de.py
  --- a/custom_components/waste_collection_schedule/waste_collection_schedule/source/abki_de.py
  +++ b/custom_components/waste_collection_schedule/waste_collection_schedule/source/abki_de.py
  @@ -90,7 +90,7 @@
               try:
                   r = session.get("https://abki.de/abki-services/leerungen-data", params={
                       "Zeitraum": now.year+1,
  -                    "Strasse_input": "Aarhusstraße",
  +                    "Strasse_input": self._street,
                       "Strasse": street_id,
                       "IDSTANDORT_input": 2,
                       "IDSTANDORT": standort_id,
  
verification_info: {"golden_diff": "diff --git a/custom_components/waste_collection_schedule/waste_collection_schedule/source/abki_de.py b/custom_components/waste_collection_schedule/waste_collection_schedule/source/abki_de.py\n--- a/custom_components/waste_collection_schedule/waste_collection_schedule/source/abki_de.py\n+++ b/custom_components/waste_collection_schedule/waste_collection_schedule/source/abki_de.py\n@@ -90,7 +90,7 @@\n             try:\n                 r = session.get(\"https://abki.de/abki-services/leerungen-data\", params={\n                     \"Zeitraum\": now.year+1,\n-                    \"Strasse_input\": \"Aarhusstra\u00dfe\",\n+                    \"Strasse_input\": self._street,\n                     \"Strasse\": street_id,\n                     \"IDSTANDORT_input\": 2,\n                     \"IDSTANDORT\": standort_id,\n", "issue": "fixing abki_de recycling\nfix for #891\n", "before_files": [{"content": "import requests\nfrom waste_collection_schedule import Collection  # type: ignore[attr-defined]\nfrom waste_collection_schedule.service.ICS import ICS\n\nfrom datetime import datetime\nimport logging\n\nTITLE = \"Abfallwirtschaftsbetrieb Kiel (ABK)\"\nDESCRIPTION = \"Source for Abfallwirtschaftsbetrieb Kiel (ABK).\"\nURL = \"https://abki.de/\"\nTEST_CASES = {\n    \"auguste-viktoria-stra\u00dfe, 14\": {\"street\": \"auguste-viktoria-stra\u00dfe\", \"number\": 14},\n    \"Achterwehrer Stra\u00dfe, 1 A\": {\"street\": \"Achterwehrer Stra\u00dfe\", \"number\": \"1 a\"},\n    \"Boltenhagener Stra\u00dfe, 4-8\": {\"street\": \"Boltenhagener Stra\u00dfe\", \"number\": \"4-8\"},\n}\n\n\nICON_MAP = {\n    \"Restabfall\": \"mdi:trash-can\",\n    \"Glass\": \"mdi:bottle-soda\",\n    \"Bioabfall\": \"mdi:leaf\",\n    \"Papier\": \"mdi:package-variant\",\n    \"Gelbe\": \"mdi:recycle\",\n}\n\n\nICAL_URL = \"https://abki.de/abki-services/abki-leerungen-ical\"\n_LOGGER = logging.getLogger(__name__)\n\n\nclass Source:\n    def __init__(self, street: str, number: str | int):\n        self._street: str = street\n        self._number: str = str(number)\n        self._ics = ICS()\n\n    def fetch(self):\n        now = datetime.now()\n        session = requests.Session()\n\n        # get street id\n        params = f'filter[logic]=and&filter[filters][0][value]={self._street}&filter[filters][0][field]=Strasse&filter[filters][0][operator]=startswith&filter[filters][0][ignoreCase]=true'\n        r = session.get(\n            \"https://abki.de/abki-services/strassennamen\", params=params)  # , params=params)\n        r.raise_for_status()\n\n        streets = r.json()\n        if len(streets) > 1:\n            _LOGGER.warning(\n                \"Multiple streets found please be more specific, using first one: \"+streets[0][\"Strasse\"])\n        if len(streets) < 1:\n            raise ValueError(\"No street found\", self._street)\n\n        street_id = streets[0][\"IDSTREET\"]\n\n        # get number id\n        r = session.get(\"https://abki.de/abki-services/streetnumber\",\n                        params={\"IDSTREET\": street_id})\n        r.raise_for_status()\n        numbers = r.json()\n        number_id, standort_id = None, None\n        for number in numbers:\n            if number[\"NUMBER\"].lower().replace(\" \", \"\").replace(\"-\", \"\") == self._number.lower().replace(\" \", \"\").replace(\"-\", \"\"):\n                number_id = number[\"id\"]\n                standort_id = number[\"IDSTANDORT\"]\n                break\n        \n        if number_id is None:\n            raise ValueError(\"No number found\", self._number)\n\n        # get ics file link\n        r = session.get(\"https://abki.de/abki-services/leerungen-data\", params={\n            \"Zeitraum\": now.year,\n            \"Strasse_input\": self._street,\n            \"Strasse\": street_id,\n            \"IDSTANDORT_input\": 2,\n            \"IDSTANDORT\": standort_id,\n            \"Hausnummernwahl\": number_id\n        })\n        r.raise_for_status()\n        request_data = r.json()[\"dataFile\"]\n\n        # get ICS file\n        r = session.get(ICAL_URL, params={\"data\": request_data})\n\n        dates = self._ics.convert(r.text)\n\n        # if december, also try to get next year\n        if now.month == 12:\n            try:\n                r = session.get(\"https://abki.de/abki-services/leerungen-data\", params={\n                    \"Zeitraum\": now.year+1,\n                    \"Strasse_input\": \"Aarhusstra\u00dfe\",\n                    \"Strasse\": street_id,\n                    \"IDSTANDORT_input\": 2,\n                    \"IDSTANDORT\": standort_id,\n                    \"Hausnummernwahl\": number_id\n                })\n                r.raise_for_status()\n                request_data = r.json()[\"dataFile\"]\n                r = session.get(ICAL_URL, params={\"data\": request_data})\n                dates += self._ics.convert(r.text)\n            except:\n                pass\n\n        entries = []\n        for d in dates:\n            entries.append(Collection(\n                d[0], d[1], ICON_MAP.get(d[1].split(\" \")[0])))\n\n        return entries\n", "path": "custom_components/waste_collection_schedule/waste_collection_schedule/source/abki_de.py"}], "after_files": [{"content": "import requests\nfrom waste_collection_schedule import Collection  # type: ignore[attr-defined]\nfrom waste_collection_schedule.service.ICS import ICS\n\nfrom datetime import datetime\nimport logging\n\nTITLE = \"Abfallwirtschaftsbetrieb Kiel (ABK)\"\nDESCRIPTION = \"Source for Abfallwirtschaftsbetrieb Kiel (ABK).\"\nURL = \"https://abki.de/\"\nTEST_CASES = {\n    \"auguste-viktoria-stra\u00dfe, 14\": {\"street\": \"auguste-viktoria-stra\u00dfe\", \"number\": 14},\n    \"Achterwehrer Stra\u00dfe, 1 A\": {\"street\": \"Achterwehrer Stra\u00dfe\", \"number\": \"1 a\"},\n    \"Boltenhagener Stra\u00dfe, 4-8\": {\"street\": \"Boltenhagener Stra\u00dfe\", \"number\": \"4-8\"},\n}\n\n\nICON_MAP = {\n    \"Restabfall\": \"mdi:trash-can\",\n    \"Glass\": \"mdi:bottle-soda\",\n    \"Bioabfall\": \"mdi:leaf\",\n    \"Papier\": \"mdi:package-variant\",\n    \"Gelbe\": \"mdi:recycle\",\n}\n\n\nICAL_URL = \"https://abki.de/abki-services/abki-leerungen-ical\"\n_LOGGER = logging.getLogger(__name__)\n\n\nclass Source:\n    def __init__(self, street: str, number: str | int):\n        self._street: str = street\n        self._number: str = str(number)\n        self._ics = ICS()\n\n    def fetch(self):\n        now = datetime.now()\n        session = requests.Session()\n\n        # get street id\n        params = f'filter[logic]=and&filter[filters][0][value]={self._street}&filter[filters][0][field]=Strasse&filter[filters][0][operator]=startswith&filter[filters][0][ignoreCase]=true'\n        r = session.get(\n            \"https://abki.de/abki-services/strassennamen\", params=params)  # , params=params)\n        r.raise_for_status()\n\n        streets = r.json()\n        if len(streets) > 1:\n            _LOGGER.warning(\n                \"Multiple streets found please be more specific, using first one: \"+streets[0][\"Strasse\"])\n        if len(streets) < 1:\n            raise ValueError(\"No street found\", self._street)\n\n        street_id = streets[0][\"IDSTREET\"]\n\n        # get number id\n        r = session.get(\"https://abki.de/abki-services/streetnumber\",\n                        params={\"IDSTREET\": street_id})\n        r.raise_for_status()\n        numbers = r.json()\n        number_id, standort_id = None, None\n        for number in numbers:\n            if number[\"NUMBER\"].lower().replace(\" \", \"\").replace(\"-\", \"\") == self._number.lower().replace(\" \", \"\").replace(\"-\", \"\"):\n                number_id = number[\"id\"]\n                standort_id = number[\"IDSTANDORT\"]\n                break\n        \n        if number_id is None:\n            raise ValueError(\"No number found\", self._number)\n\n        # get ics file link\n        r = session.get(\"https://abki.de/abki-services/leerungen-data\", params={\n            \"Zeitraum\": now.year,\n            \"Strasse_input\": self._street,\n            \"Strasse\": street_id,\n            \"IDSTANDORT_input\": 2,\n            \"IDSTANDORT\": standort_id,\n            \"Hausnummernwahl\": number_id\n        })\n        r.raise_for_status()\n        request_data = r.json()[\"dataFile\"]\n\n        # get ICS file\n        r = session.get(ICAL_URL, params={\"data\": request_data})\n\n        dates = self._ics.convert(r.text)\n\n        # if december, also try to get next year\n        if now.month == 12:\n            try:\n                r = session.get(\"https://abki.de/abki-services/leerungen-data\", params={\n                    \"Zeitraum\": now.year+1,\n                    \"Strasse_input\": self._street,\n                    \"Strasse\": street_id,\n                    \"IDSTANDORT_input\": 2,\n                    \"IDSTANDORT\": standort_id,\n                    \"Hausnummernwahl\": number_id\n                })\n                r.raise_for_status()\n                request_data = r.json()[\"dataFile\"]\n                r = session.get(ICAL_URL, params={\"data\": request_data})\n                dates += self._ics.convert(r.text)\n            except:\n                pass\n\n        entries = []\n        for d in dates:\n            entries.append(Collection(\n                d[0], d[1], ICON_MAP.get(d[1].split(\" \")[0])))\n\n        return entries\n", "path": "custom_components/waste_collection_schedule/waste_collection_schedule/source/abki_de.py"}]}