prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  [Bug]: day_switch_time does not seem to be working correctly
  ### I Have A Problem With:
  
  The integration in general
  
  ### What's Your Problem
  
  I have day switch time set to `20:00` but the day switches at `01:19`
  
  <img width="228" alt="Screenshot 2024-05-08 at 07 24 31" src="https://github.com/mampfes/hacs_waste_collection_schedule/assets/49797976/c84d1086-1fd8-462a-a206-77ed846838a0">
  
  config:
  
  ```
  waste_collection_schedule:
    sources:
      - name: maldon_gov_uk
        args:
          uprn: "uprn"
        customize:
          - type: Refuse Collection
          - type: Recycling
    day_switch_time: "20:00"
    fetch_time: 01:00
  ```
  
  
  ### Source (if relevant)
  
  Maldon District Council / maldon.gov.uk
  
  ### Logs
  
  _No response_
  
  ### Relevant Configuration
  
  ```YAML
  waste_collection_schedule:
    sources:
      - name: maldon_gov_uk
        args:
          uprn: "uprn"
        customize:
          - type: Refuse Collection
          - type: Recycling
    day_switch_time: "20:00"
    fetch_time: 01:00
  ```
  
  
  ### Checklist Source Error
  
  - [ ] 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
  - [ ] 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.
  
  --- 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/maldon_gov_uk.py`
  Content:
  ```
  1 import re
  2 from datetime import datetime
  3 
  4 import requests
  5 from bs4 import BeautifulSoup
  6 from waste_collection_schedule import Collection
  7 
  8 TITLE = "Maldon District Council"
  9 
  10 DESCRIPTION = ("Source for www.maldon.gov.uk services for Maldon, UK")
  11 
  12 URL = "https://www.maldon.gov.uk/"
  13 
  14 TEST_CASES = {
  15     "test 1": {"uprn": "200000917928"},
  16     "test 2": {"uprn": "100091258454"},
  17 }
  18 
  19 API_URL = "https://maldon.suez.co.uk/maldon/ServiceSummary?uprn="
  20 
  21 ICON_MAP = {
  22     "Refuse Collection": "mdi:trash-can",
  23     "Recycling": "mdi:recycle",
  24     "Green": "mdi:leaf",
  25     "Food": "mdi:food-apple",
  26 }
  27 
  28 class Source:
  29     def __init__(self, uprn: str):
  30         self._uprn = uprn
  31 
  32     def _extract_future_date(self, text):
  33         # parse both dates and return the future one
  34         dates = re.findall(r'\d{2}/\d{2}/\d{4}', text)
  35         dates = [datetime.strptime(date, '%d/%m/%Y').date() for date in dates]
  36         return max(dates)
  37 
  38     def fetch(self):
  39         entries = []
  40 
  41         session = requests.Session()
  42 
  43         r = session.get(f"{API_URL}{self._uprn}")
  44         soup = BeautifulSoup(r.text, features="html.parser")
  45         collections = soup.find_all("div", {"class": "panel-default"})
  46 
  47         if not collections:
  48             raise Exception("No collections found for given UPRN")
  49 
  50         for collection in collections:
  51             # check is a collection row
  52             title = collection.find("h2", {"class": "panel-title"}).text.strip()
  53 
  54             if title == "Other Services" or "You are not currently subscribed" in collection.text:
  55                 continue
  56 
  57             entries.append(
  58                 Collection(
  59                     date=self._extract_future_date(collection.text),
  60                     t=title,
  61                     icon=ICON_MAP.get(title),
  62                 )
  63             )
  64 
  65         return entries
  66
  ```
  --- 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/maldon_gov_uk.py b/custom_components/waste_collection_schedule/waste_collection_schedule/source/maldon_gov_uk.py
  --- a/custom_components/waste_collection_schedule/waste_collection_schedule/source/maldon_gov_uk.py
  +++ b/custom_components/waste_collection_schedule/waste_collection_schedule/source/maldon_gov_uk.py
  @@ -3,17 +3,17 @@
   
   import requests
   from bs4 import BeautifulSoup
  -from waste_collection_schedule import Collection
  +from waste_collection_schedule import Collection  # type: ignore[attr-defined]
   
   TITLE = "Maldon District Council"
   
  -DESCRIPTION = ("Source for www.maldon.gov.uk services for Maldon, UK")
  +DESCRIPTION = "Source for www.maldon.gov.uk services for Maldon, UK"
   
   URL = "https://www.maldon.gov.uk/"
   
   TEST_CASES = {
       "test 1": {"uprn": "200000917928"},
  -    "test 2": {"uprn": "100091258454"},
  +    "test 2": {"uprn": 100091258454},
   }
   
   API_URL = "https://maldon.suez.co.uk/maldon/ServiceSummary?uprn="
  @@ -25,15 +25,15 @@
       "Food": "mdi:food-apple",
   }
   
  +
   class Source:
       def __init__(self, uprn: str):
           self._uprn = uprn
   
  -    def _extract_future_date(self, text):
  +    def _extract_dates(self, text):
           # parse both dates and return the future one
  -        dates = re.findall(r'\d{2}/\d{2}/\d{4}', text)
  -        dates = [datetime.strptime(date, '%d/%m/%Y').date() for date in dates]
  -        return max(dates)
  +        dates = re.findall(r"\d{2}/\d{2}/\d{4}", text)
  +        return [datetime.strptime(date, "%d/%m/%Y").date() for date in dates]
   
       def fetch(self):
           entries = []
  @@ -51,15 +51,19 @@
               # check is a collection row
               title = collection.find("h2", {"class": "panel-title"}).text.strip()
   
  -            if title == "Other Services" or "You are not currently subscribed" in collection.text:
  +            if (
  +                title == "Other Services"
  +                or "You are not currently subscribed" in collection.text
  +            ):
                   continue
   
  -            entries.append(
  -                Collection(
  -                    date=self._extract_future_date(collection.text),
  -                    t=title,
  -                    icon=ICON_MAP.get(title),
  +            for date in self._extract_dates(collection.text):
  +                entries.append(
  +                    Collection(
  +                        date=date,
  +                        t=title,
  +                        icon=ICON_MAP.get(title),
  +                    )
                   )
  -            )
   
           return entries
  
verification_info: {"golden_diff": "diff --git a/custom_components/waste_collection_schedule/waste_collection_schedule/source/maldon_gov_uk.py b/custom_components/waste_collection_schedule/waste_collection_schedule/source/maldon_gov_uk.py\n--- a/custom_components/waste_collection_schedule/waste_collection_schedule/source/maldon_gov_uk.py\n+++ b/custom_components/waste_collection_schedule/waste_collection_schedule/source/maldon_gov_uk.py\n@@ -3,17 +3,17 @@\n \n import requests\n from bs4 import BeautifulSoup\n-from waste_collection_schedule import Collection\n+from waste_collection_schedule import Collection  # type: ignore[attr-defined]\n \n TITLE = \"Maldon District Council\"\n \n-DESCRIPTION = (\"Source for www.maldon.gov.uk services for Maldon, UK\")\n+DESCRIPTION = \"Source for www.maldon.gov.uk services for Maldon, UK\"\n \n URL = \"https://www.maldon.gov.uk/\"\n \n TEST_CASES = {\n     \"test 1\": {\"uprn\": \"200000917928\"},\n-    \"test 2\": {\"uprn\": \"100091258454\"},\n+    \"test 2\": {\"uprn\": 100091258454},\n }\n \n API_URL = \"https://maldon.suez.co.uk/maldon/ServiceSummary?uprn=\"\n@@ -25,15 +25,15 @@\n     \"Food\": \"mdi:food-apple\",\n }\n \n+\n class Source:\n     def __init__(self, uprn: str):\n         self._uprn = uprn\n \n-    def _extract_future_date(self, text):\n+    def _extract_dates(self, text):\n         # parse both dates and return the future one\n-        dates = re.findall(r'\\d{2}/\\d{2}/\\d{4}', text)\n-        dates = [datetime.strptime(date, '%d/%m/%Y').date() for date in dates]\n-        return max(dates)\n+        dates = re.findall(r\"\\d{2}/\\d{2}/\\d{4}\", text)\n+        return [datetime.strptime(date, \"%d/%m/%Y\").date() for date in dates]\n \n     def fetch(self):\n         entries = []\n@@ -51,15 +51,19 @@\n             # check is a collection row\n             title = collection.find(\"h2\", {\"class\": \"panel-title\"}).text.strip()\n \n-            if title == \"Other Services\" or \"You are not currently subscribed\" in collection.text:\n+            if (\n+                title == \"Other Services\"\n+                or \"You are not currently subscribed\" in collection.text\n+            ):\n                 continue\n \n-            entries.append(\n-                Collection(\n-                    date=self._extract_future_date(collection.text),\n-                    t=title,\n-                    icon=ICON_MAP.get(title),\n+            for date in self._extract_dates(collection.text):\n+                entries.append(\n+                    Collection(\n+                        date=date,\n+                        t=title,\n+                        icon=ICON_MAP.get(title),\n+                    )\n                 )\n-            )\n \n         return entries\n", "issue": "[Bug]: day_switch_time does not seem to be working correctly\n### I Have A Problem With:\n\nThe integration in general\n\n### What's Your Problem\n\nI have day switch time set to `20:00` but the day switches at `01:19`\r\n\r\n<img width=\"228\" alt=\"Screenshot 2024-05-08 at 07 24 31\" src=\"https://github.com/mampfes/hacs_waste_collection_schedule/assets/49797976/c84d1086-1fd8-462a-a206-77ed846838a0\">\r\n\r\nconfig:\r\n\r\n```\r\nwaste_collection_schedule:\r\n  sources:\r\n    - name: maldon_gov_uk\r\n      args:\r\n        uprn: \"uprn\"\r\n      customize:\r\n        - type: Refuse Collection\r\n        - type: Recycling\r\n  day_switch_time: \"20:00\"\r\n  fetch_time: 01:00\r\n```\r\n\n\n### Source (if relevant)\n\nMaldon District Council / maldon.gov.uk\n\n### Logs\n\n_No response_\n\n### Relevant Configuration\n\n```YAML\nwaste_collection_schedule:\r\n  sources:\r\n    - name: maldon_gov_uk\r\n      args:\r\n        uprn: \"uprn\"\r\n      customize:\r\n        - type: Refuse Collection\r\n        - type: Recycling\r\n  day_switch_time: \"20:00\"\r\n  fetch_time: 01:00\n```\n\n\n### Checklist Source Error\n\n- [ ] 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- [ ] 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 re\nfrom datetime import datetime\n\nimport requests\nfrom bs4 import BeautifulSoup\nfrom waste_collection_schedule import Collection\n\nTITLE = \"Maldon District Council\"\n\nDESCRIPTION = (\"Source for www.maldon.gov.uk services for Maldon, UK\")\n\nURL = \"https://www.maldon.gov.uk/\"\n\nTEST_CASES = {\n    \"test 1\": {\"uprn\": \"200000917928\"},\n    \"test 2\": {\"uprn\": \"100091258454\"},\n}\n\nAPI_URL = \"https://maldon.suez.co.uk/maldon/ServiceSummary?uprn=\"\n\nICON_MAP = {\n    \"Refuse Collection\": \"mdi:trash-can\",\n    \"Recycling\": \"mdi:recycle\",\n    \"Green\": \"mdi:leaf\",\n    \"Food\": \"mdi:food-apple\",\n}\n\nclass Source:\n    def __init__(self, uprn: str):\n        self._uprn = uprn\n\n    def _extract_future_date(self, text):\n        # parse both dates and return the future one\n        dates = re.findall(r'\\d{2}/\\d{2}/\\d{4}', text)\n        dates = [datetime.strptime(date, '%d/%m/%Y').date() for date in dates]\n        return max(dates)\n\n    def fetch(self):\n        entries = []\n\n        session = requests.Session()\n\n        r = session.get(f\"{API_URL}{self._uprn}\")\n        soup = BeautifulSoup(r.text, features=\"html.parser\")\n        collections = soup.find_all(\"div\", {\"class\": \"panel-default\"})\n\n        if not collections:\n            raise Exception(\"No collections found for given UPRN\")\n\n        for collection in collections:\n            # check is a collection row\n            title = collection.find(\"h2\", {\"class\": \"panel-title\"}).text.strip()\n\n            if title == \"Other Services\" or \"You are not currently subscribed\" in collection.text:\n                continue\n\n            entries.append(\n                Collection(\n                    date=self._extract_future_date(collection.text),\n                    t=title,\n                    icon=ICON_MAP.get(title),\n                )\n            )\n\n        return entries\n", "path": "custom_components/waste_collection_schedule/waste_collection_schedule/source/maldon_gov_uk.py"}], "after_files": [{"content": "import re\nfrom datetime import datetime\n\nimport requests\nfrom bs4 import BeautifulSoup\nfrom waste_collection_schedule import Collection  # type: ignore[attr-defined]\n\nTITLE = \"Maldon District Council\"\n\nDESCRIPTION = \"Source for www.maldon.gov.uk services for Maldon, UK\"\n\nURL = \"https://www.maldon.gov.uk/\"\n\nTEST_CASES = {\n    \"test 1\": {\"uprn\": \"200000917928\"},\n    \"test 2\": {\"uprn\": 100091258454},\n}\n\nAPI_URL = \"https://maldon.suez.co.uk/maldon/ServiceSummary?uprn=\"\n\nICON_MAP = {\n    \"Refuse Collection\": \"mdi:trash-can\",\n    \"Recycling\": \"mdi:recycle\",\n    \"Green\": \"mdi:leaf\",\n    \"Food\": \"mdi:food-apple\",\n}\n\n\nclass Source:\n    def __init__(self, uprn: str):\n        self._uprn = uprn\n\n    def _extract_dates(self, text):\n        # parse both dates and return the future one\n        dates = re.findall(r\"\\d{2}/\\d{2}/\\d{4}\", text)\n        return [datetime.strptime(date, \"%d/%m/%Y\").date() for date in dates]\n\n    def fetch(self):\n        entries = []\n\n        session = requests.Session()\n\n        r = session.get(f\"{API_URL}{self._uprn}\")\n        soup = BeautifulSoup(r.text, features=\"html.parser\")\n        collections = soup.find_all(\"div\", {\"class\": \"panel-default\"})\n\n        if not collections:\n            raise Exception(\"No collections found for given UPRN\")\n\n        for collection in collections:\n            # check is a collection row\n            title = collection.find(\"h2\", {\"class\": \"panel-title\"}).text.strip()\n\n            if (\n                title == \"Other Services\"\n                or \"You are not currently subscribed\" in collection.text\n            ):\n                continue\n\n            for date in self._extract_dates(collection.text):\n                entries.append(\n                    Collection(\n                        date=date,\n                        t=title,\n                        icon=ICON_MAP.get(title),\n                    )\n                )\n\n        return entries\n", "path": "custom_components/waste_collection_schedule/waste_collection_schedule/source/maldon_gov_uk.py"}]}