prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  [Bug]: Collection events for sbazv_de double in calendar
  ### I Have A Problem With:
  
  A specific source
  
  ### What's Your Problem
  
  Collection dates and types are pulled correctly into the calendar but events show up twice per day. Sensor for next collection ('AbfallTermin') reads 'Gelber Sack, Gelber Sack in 7 Tagen'. Config and logs look ok.
  ![calendar](https://github.com/mampfes/hacs_waste_collection_schedule/assets/153497296/361fa025-6043-4c12-9f2f-7749d7e68e4a)
  
  
  
  ### Source (if relevant)
  
  sbazv_de
  
  ### Logs
  
  ```Shell
  no relevant logs
  ```
  
  
  ### Relevant Configuration
  
  ```YAML
  waste_collection_schedule:
    sources:
      - name: sbazv_de
        args:
          city: Schönefeld
          district: Großziethen
          street: Kxxxxxxxx
        customize:
          - type: Restmülltonnen
            alias: Restmuell
            icon: mdi:trash-can   
          - type: Gelbe Säcke
            alias: GelberSack
            icon: mdi:recycle
          - type: Papiertonnen
            alias: Altpapier
            icon: mdi:file-document
          - type: Laubsäcke
            alias: Laubsack
            icon: mdi:trash-can
            use_dedicated_calendar: false
            dedicated_calendar_title: SBAZV
    fetch_time: "04:00"
    day_switch_time: "12:00"
  
  sensor:
    # ------- Waste Collection Schedule ------- 
    # Nächster Abholtermin
    - platform: waste_collection_schedule
      name: "AbfallTermin"
      value_template: '{{value.types|join(", ")}}{% if value.daysTo == 0 %} Heute{% elif value.daysTo == 1 %} Morgen{% else %} in {{value.daysTo}} Tagen{% endif %}'
  ```
  
  
  ### Checklist Source Error
  
  - [X] Use the example parameters for your source (often available in the documentation) (don't forget to restart Home Assistant after changing the configuration)
  - [X] Checked that the website of your service provider is still working
  - [X] Tested my attributes on the service provider website (if possible)
  - [X] I have tested with the latest version of the integration (master) (for HACS in the 3 dot menu of the integration click on "Redownload" and choose master as version)
  
  ### Checklist Sensor Error
  
  - [X] Checked in the Home Assistant Calendar tab if the event names match the types names (if types argument is used)
  
  ### Required
  
  - [X] I have searched past (closed AND opened) issues to see if this bug has already been reported, and it hasn't been.
  - [X] I understand that people give their precious time for free, and thus I've done my very best to make this problem as easy as possible to investigate.
  
  </issue>
  <code>
  [start of custom_components/waste_collection_schedule/waste_collection_schedule/source/sbazv_de.py]
  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 TITLE = "Südbrandenburgischer Abfallzweckverband"
  6 DESCRIPTION = "SBAZV Brandenburg, Deutschland"
  7 URL = "https://www.sbazv.de"
  8 TEST_CASES = {
  9     "Wildau": {"city": "wildau", "district": "Wildau", "street": "Miersdorfer Str."}
  10 }
  11 
  12 ICON_MAP = {
  13     "Restmülltonnen": "mdi:trash-can",
  14     "Laubsäcke": "mdi:leaf",
  15     "Gelbe Säcke": "mdi:sack",
  16     "Papiertonnen": "mdi:package-variant",
  17     "Weihnachtsbäume": "mdi:pine-tree",
  18 }
  19 
  20 # _LOGGER = logging.getLogger(__name__)
  21 
  22 
  23 class Source:
  24     def __init__(self, city, district, street=None):
  25         self._city = city
  26         self._district = district
  27         self._street = street
  28         self._ics = ICS()
  29 
  30     def fetch(self):
  31         args = {
  32             "city": self._city,
  33             "district": self._district,
  34             "street": self._street,
  35         }
  36 
  37         # get ics file
  38         # https://www.sbazv.de/entsorgungstermine/klein.ics?city=Wildau&district=Wildau&street=Miersdorfer+Str.
  39         r = requests.get(
  40             "https://www.sbazv.de/entsorgungstermine/klein.ics", params=args
  41         )
  42 
  43         # parse ics file
  44         dates = self._ics.convert(r.text)
  45 
  46         entries = []
  47         for d in dates:
  48             waste_type = d[1].strip()
  49             next_pickup_date = d[0]
  50 
  51             entries.append(
  52                 Collection(
  53                     date=next_pickup_date,
  54                     t=waste_type,
  55                     icon=ICON_MAP.get(waste_type),
  56                 )
  57             )
  58 
  59         return entries
  60
  [end of custom_components/waste_collection_schedule/waste_collection_schedule/source/sbazv_de.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/custom_components/waste_collection_schedule/waste_collection_schedule/source/sbazv_de.py b/custom_components/waste_collection_schedule/waste_collection_schedule/source/sbazv_de.py
  --- a/custom_components/waste_collection_schedule/waste_collection_schedule/source/sbazv_de.py
  +++ b/custom_components/waste_collection_schedule/waste_collection_schedule/source/sbazv_de.py
  @@ -6,7 +6,12 @@
   DESCRIPTION = "SBAZV Brandenburg, Deutschland"
   URL = "https://www.sbazv.de"
   TEST_CASES = {
  -    "Wildau": {"city": "wildau", "district": "Wildau", "street": "Miersdorfer Str."}
  +    "Wildau": {"city": "wildau", "district": "Wildau", "street": "Miersdorfer Str."},
  +    "Schönefeld": {
  +        "city": "Schönefeld",
  +        "district": "Großziethen",
  +        "street": "kleistring",
  +    },
   }
   
   ICON_MAP = {
  @@ -47,7 +52,11 @@
           for d in dates:
               waste_type = d[1].strip()
               next_pickup_date = d[0]
  -
  +            # remove duplicates
  +            if any(
  +                e.date == next_pickup_date and e.type == waste_type for e in entries
  +            ):
  +                continue
               entries.append(
                   Collection(
                       date=next_pickup_date,
  
verification_info: {"golden_diff": "diff --git a/custom_components/waste_collection_schedule/waste_collection_schedule/source/sbazv_de.py b/custom_components/waste_collection_schedule/waste_collection_schedule/source/sbazv_de.py\n--- a/custom_components/waste_collection_schedule/waste_collection_schedule/source/sbazv_de.py\n+++ b/custom_components/waste_collection_schedule/waste_collection_schedule/source/sbazv_de.py\n@@ -6,7 +6,12 @@\n DESCRIPTION = \"SBAZV Brandenburg, Deutschland\"\n URL = \"https://www.sbazv.de\"\n TEST_CASES = {\n-    \"Wildau\": {\"city\": \"wildau\", \"district\": \"Wildau\", \"street\": \"Miersdorfer Str.\"}\n+    \"Wildau\": {\"city\": \"wildau\", \"district\": \"Wildau\", \"street\": \"Miersdorfer Str.\"},\n+    \"Sch\u00f6nefeld\": {\n+        \"city\": \"Sch\u00f6nefeld\",\n+        \"district\": \"Gro\u00dfziethen\",\n+        \"street\": \"kleistring\",\n+    },\n }\n \n ICON_MAP = {\n@@ -47,7 +52,11 @@\n         for d in dates:\n             waste_type = d[1].strip()\n             next_pickup_date = d[0]\n-\n+            # remove duplicates\n+            if any(\n+                e.date == next_pickup_date and e.type == waste_type for e in entries\n+            ):\n+                continue\n             entries.append(\n                 Collection(\n                     date=next_pickup_date,\n", "issue": "[Bug]: Collection events for sbazv_de double in calendar\n### I Have A Problem With:\n\nA specific source\n\n### What's Your Problem\n\nCollection dates and types are pulled correctly into the calendar but events show up twice per day. Sensor for next collection ('AbfallTermin') reads 'Gelber Sack, Gelber Sack in 7 Tagen'. Config and logs look ok.\r\n![calendar](https://github.com/mampfes/hacs_waste_collection_schedule/assets/153497296/361fa025-6043-4c12-9f2f-7749d7e68e4a)\r\n\r\n\n\n### Source (if relevant)\n\nsbazv_de\n\n### Logs\n\n```Shell\nno relevant logs\n```\n\n\n### Relevant Configuration\n\n```YAML\nwaste_collection_schedule:\r\n  sources:\r\n    - name: sbazv_de\r\n      args:\r\n        city: Sch\u00f6nefeld\r\n        district: Gro\u00dfziethen\r\n        street: Kxxxxxxxx\r\n      customize:\r\n        - type: Restm\u00fclltonnen\r\n          alias: Restmuell\r\n          icon: mdi:trash-can   \r\n        - type: Gelbe S\u00e4cke\r\n          alias: GelberSack\r\n          icon: mdi:recycle\r\n        - type: Papiertonnen\r\n          alias: Altpapier\r\n          icon: mdi:file-document\r\n        - type: Laubs\u00e4cke\r\n          alias: Laubsack\r\n          icon: mdi:trash-can\r\n          use_dedicated_calendar: false\r\n          dedicated_calendar_title: SBAZV\r\n  fetch_time: \"04:00\"\r\n  day_switch_time: \"12:00\"\r\n\r\nsensor:\r\n  # ------- Waste Collection Schedule ------- \r\n  # N\u00e4chster Abholtermin\r\n  - platform: waste_collection_schedule\r\n    name: \"AbfallTermin\"\r\n    value_template: '{{value.types|join(\", \")}}{% if value.daysTo == 0 %} Heute{% elif value.daysTo == 1 %} Morgen{% else %} in {{value.daysTo}} Tagen{% endif %}'\n```\n\n\n### Checklist Source Error\n\n- [X] Use the example parameters for your source (often available in the documentation) (don't forget to restart Home Assistant after changing the configuration)\n- [X] Checked that the website of your service provider is still working\n- [X] Tested my attributes on the service provider website (if possible)\n- [X] I have tested with the latest version of the integration (master) (for HACS in the 3 dot menu of the integration click on \"Redownload\" and choose master as version)\n\n### Checklist Sensor Error\n\n- [X] Checked in the Home Assistant Calendar tab if the event names match the types names (if types argument is used)\n\n### Required\n\n- [X] I have searched past (closed AND opened) issues to see if this bug has already been reported, and it hasn't been.\n- [X] I understand that people give their precious time for free, and thus I've done my very best to make this problem as easy as possible to investigate.\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\nTITLE = \"S\u00fcdbrandenburgischer Abfallzweckverband\"\nDESCRIPTION = \"SBAZV Brandenburg, Deutschland\"\nURL = \"https://www.sbazv.de\"\nTEST_CASES = {\n    \"Wildau\": {\"city\": \"wildau\", \"district\": \"Wildau\", \"street\": \"Miersdorfer Str.\"}\n}\n\nICON_MAP = {\n    \"Restm\u00fclltonnen\": \"mdi:trash-can\",\n    \"Laubs\u00e4cke\": \"mdi:leaf\",\n    \"Gelbe S\u00e4cke\": \"mdi:sack\",\n    \"Papiertonnen\": \"mdi:package-variant\",\n    \"Weihnachtsb\u00e4ume\": \"mdi:pine-tree\",\n}\n\n# _LOGGER = logging.getLogger(__name__)\n\n\nclass Source:\n    def __init__(self, city, district, street=None):\n        self._city = city\n        self._district = district\n        self._street = street\n        self._ics = ICS()\n\n    def fetch(self):\n        args = {\n            \"city\": self._city,\n            \"district\": self._district,\n            \"street\": self._street,\n        }\n\n        # get ics file\n        # https://www.sbazv.de/entsorgungstermine/klein.ics?city=Wildau&district=Wildau&street=Miersdorfer+Str.\n        r = requests.get(\n            \"https://www.sbazv.de/entsorgungstermine/klein.ics\", params=args\n        )\n\n        # parse ics file\n        dates = self._ics.convert(r.text)\n\n        entries = []\n        for d in dates:\n            waste_type = d[1].strip()\n            next_pickup_date = d[0]\n\n            entries.append(\n                Collection(\n                    date=next_pickup_date,\n                    t=waste_type,\n                    icon=ICON_MAP.get(waste_type),\n                )\n            )\n\n        return entries\n", "path": "custom_components/waste_collection_schedule/waste_collection_schedule/source/sbazv_de.py"}]}