prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  [Bug]: Haringey Waste Collection sensor returning 'Unknown'
  ### I Have A Problem With:
  
  A specific source
  
  ### What's Your Problem
  
  I am having an issue adding the Haringey council (UK) Waste Collection sensor into HA. The sensor value shows as 'Unknown'.
  
  I have added this code to my configuration.yaml (replacing "My UPRN" with my actual UPRN):
  
  ```
    sources:
      - name: haringey_gov_uk
        args:
          uprn: "My UPRN"
  
  sensor:
    - platform: waste_collection_schedule
      name: "Haringey Waste Collection"
      details_format: upcoming
      value_template: 'in {{value.daysTo}} days'
  ```
  
  ![haringeywastecollection](https://github.com/mampfes/hacs_waste_collection_schedule/assets/26800901/41d18b20-8922-48b1-94dc-865ae9ac568c)
  
  I have tested with other configs for other councils I found online and those work as expected. Is there something wrong with the Haringey data feed? The URL mentioned in the documentation is still correct, and I can see the correct information on the Haringey website.
  
  ### Source (if relevant)
  
  _No response_
  
  ### Logs
  
  _No response_
  
  ### Relevant Configuration
  
  _No response_
  
  ### 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/haringey_gov_uk.py]
  1 from datetime import datetime
  2 
  3 import requests
  4 from bs4 import BeautifulSoup
  5 from waste_collection_schedule import Collection  # type: ignore[attr-defined]
  6 
  7 TITLE = "Haringey Council"
  8 DESCRIPTION = "Source for haringey.gov.uk services for Haringey Council, UK."
  9 URL = "https://www.haringey.gov.uk/"
  10 TEST_CASES = {
  11     "Test_001": {"uprn": "100021209182"},
  12     "Test_002": {"uprn": "100021207181"},
  13     "Test_003": {"uprn": "100021202738"},
  14     "Test_004": {"uprn": 100021202131},
  15 }
  16 ICON_MAP = {
  17     "General Waste": "mdi:trash-can",
  18     "Collect Domestic Recycling": "mdi:recycle",
  19     "Food Waste": "mdi:food-apple",
  20     "Collect Paid Domestic Garden": "mdi:leaf",
  21 }
  22 
  23 
  24 class Source:
  25     def __init__(self, uprn):
  26         self._uprn = str(uprn).zfill(12)
  27 
  28     def fetch(self):
  29         api_url = f"https://wastecollections.haringey.gov.uk/property/{self._uprn}"
  30         response = requests.get(api_url)
  31 
  32         soup = BeautifulSoup(response.text, features="html.parser")
  33         soup.prettify()
  34 
  35         entries = []
  36 
  37         service_elements = soup.select(".service-wrapper")
  38 
  39         for service_element in service_elements:
  40             service_name = service_element.select(".service-name")[0].text.strip()
  41             next_service_date = service_element.select("td.next-service")[0]
  42 
  43             next_service_date.span.extract()
  44 
  45             entries.append(
  46                 Collection(
  47                     date=datetime.strptime(
  48                         next_service_date.text.strip(), "%d/%m/%Y"
  49                     ).date(),
  50                     t=service_name,
  51                     icon=ICON_MAP.get(service_name),
  52                 )
  53             )
  54 
  55         return entries
  56
  [end of custom_components/waste_collection_schedule/waste_collection_schedule/source/haringey_gov_uk.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/haringey_gov_uk.py b/custom_components/waste_collection_schedule/waste_collection_schedule/source/haringey_gov_uk.py
  --- a/custom_components/waste_collection_schedule/waste_collection_schedule/source/haringey_gov_uk.py
  +++ b/custom_components/waste_collection_schedule/waste_collection_schedule/source/haringey_gov_uk.py
  @@ -38,7 +38,11 @@
   
           for service_element in service_elements:
               service_name = service_element.select(".service-name")[0].text.strip()
  -            next_service_date = service_element.select("td.next-service")[0]
  +
  +            next_service_dates = service_element.select("td.next-service")
  +            if len(next_service_dates) == 0:
  +                continue
  +            next_service_date = next_service_dates[0]
   
               next_service_date.span.extract()
  
verification_info: {"golden_diff": "diff --git a/custom_components/waste_collection_schedule/waste_collection_schedule/source/haringey_gov_uk.py b/custom_components/waste_collection_schedule/waste_collection_schedule/source/haringey_gov_uk.py\n--- a/custom_components/waste_collection_schedule/waste_collection_schedule/source/haringey_gov_uk.py\n+++ b/custom_components/waste_collection_schedule/waste_collection_schedule/source/haringey_gov_uk.py\n@@ -38,7 +38,11 @@\n \n         for service_element in service_elements:\n             service_name = service_element.select(\".service-name\")[0].text.strip()\n-            next_service_date = service_element.select(\"td.next-service\")[0]\n+\n+            next_service_dates = service_element.select(\"td.next-service\")\n+            if len(next_service_dates) == 0:\n+                continue\n+            next_service_date = next_service_dates[0]\n \n             next_service_date.span.extract()\n", "issue": "[Bug]: Haringey Waste Collection sensor returning 'Unknown'\n### I Have A Problem With:\r\n\r\nA specific source\r\n\r\n### What's Your Problem\r\n\r\nI am having an issue adding the Haringey council (UK) Waste Collection sensor into HA. The sensor value shows as 'Unknown'.\r\n\r\nI have added this code to my configuration.yaml (replacing \"My UPRN\" with my actual UPRN):\r\n\r\n```\r\n  sources:\r\n    - name: haringey_gov_uk\r\n      args:\r\n        uprn: \"My UPRN\"\r\n\r\nsensor:\r\n  - platform: waste_collection_schedule\r\n    name: \"Haringey Waste Collection\"\r\n    details_format: upcoming\r\n    value_template: 'in {{value.daysTo}} days'\r\n```\r\n\r\n![haringeywastecollection](https://github.com/mampfes/hacs_waste_collection_schedule/assets/26800901/41d18b20-8922-48b1-94dc-865ae9ac568c)\r\n\r\nI have tested with other configs for other councils I found online and those work as expected. Is there something wrong with the Haringey data feed? The URL mentioned in the documentation is still correct, and I can see the correct information on the Haringey website.\r\n\r\n### Source (if relevant)\r\n\r\n_No response_\r\n\r\n### Logs\r\n\r\n_No response_\r\n\r\n### Relevant Configuration\r\n\r\n_No response_\r\n\r\n### Checklist Source Error\r\n\r\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)\r\n- [X] Checked that the website of your service provider is still working\r\n- [X] Tested my attributes on the service provider website (if possible)\r\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)\r\n\r\n### Checklist Sensor Error\r\n\r\n- [X] Checked in the Home Assistant Calendar tab if the event names match the types names (if types argument is used)\r\n\r\n### Required\r\n\r\n- [X] I have searched past (closed AND opened) issues to see if this bug has already been reported, and it hasn't been.\r\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": "from datetime import datetime\n\nimport requests\nfrom bs4 import BeautifulSoup\nfrom waste_collection_schedule import Collection  # type: ignore[attr-defined]\n\nTITLE = \"Haringey Council\"\nDESCRIPTION = \"Source for haringey.gov.uk services for Haringey Council, UK.\"\nURL = \"https://www.haringey.gov.uk/\"\nTEST_CASES = {\n    \"Test_001\": {\"uprn\": \"100021209182\"},\n    \"Test_002\": {\"uprn\": \"100021207181\"},\n    \"Test_003\": {\"uprn\": \"100021202738\"},\n    \"Test_004\": {\"uprn\": 100021202131},\n}\nICON_MAP = {\n    \"General Waste\": \"mdi:trash-can\",\n    \"Collect Domestic Recycling\": \"mdi:recycle\",\n    \"Food Waste\": \"mdi:food-apple\",\n    \"Collect Paid Domestic Garden\": \"mdi:leaf\",\n}\n\n\nclass Source:\n    def __init__(self, uprn):\n        self._uprn = str(uprn).zfill(12)\n\n    def fetch(self):\n        api_url = f\"https://wastecollections.haringey.gov.uk/property/{self._uprn}\"\n        response = requests.get(api_url)\n\n        soup = BeautifulSoup(response.text, features=\"html.parser\")\n        soup.prettify()\n\n        entries = []\n\n        service_elements = soup.select(\".service-wrapper\")\n\n        for service_element in service_elements:\n            service_name = service_element.select(\".service-name\")[0].text.strip()\n            next_service_date = service_element.select(\"td.next-service\")[0]\n\n            next_service_date.span.extract()\n\n            entries.append(\n                Collection(\n                    date=datetime.strptime(\n                        next_service_date.text.strip(), \"%d/%m/%Y\"\n                    ).date(),\n                    t=service_name,\n                    icon=ICON_MAP.get(service_name),\n                )\n            )\n\n        return entries\n", "path": "custom_components/waste_collection_schedule/waste_collection_schedule/source/haringey_gov_uk.py"}]}