prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  [Bug]: WasteNet Southland not working after 1.46.0
  ### I Have A Problem With:
  
  A specific source
  
  ### What's Your Problem
  
  The WasteNet Southland website and url has changed about a month ago. The issue created by this change was supposed to be fixed in 1.46.0, but unfortunately it is still not working.
  Tested with my address and even with the example data, returning all sensors as unknown.
  
  ### Source (if relevant)
  
  wastenet_org_nz
  
  ### Logs
  
  ```Shell
  no relevant logs
  ```
  
  
  ### 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/wastenet_org_nz.py]
  1 import re
  2 from datetime import datetime
  3 from html.parser import HTMLParser
  4 
  5 import requests
  6 from waste_collection_schedule import Collection  # type: ignore[attr-defined]
  7 
  8 TITLE = "Gore, Invercargill & Southland"
  9 DESCRIPTION = "Source for Wastenet.org.nz."
  10 URL = "http://www.wastenet.org.nz"
  11 TEST_CASES = {
  12     "166 Lewis Street": {"address": "166 Lewis Street"},
  13     "Old Format: 199 Crawford Street": {"address": "199 Crawford Street INVERCARGILL"},
  14     "Old Format: 156 Tay Street": {"address": "156 Tay Street INVERCARGILL"},
  15     "entry_id glass only": {"entry_id": "23571"},
  16     # "31 Conyers Street": {"address": "31 Conyers Street INVERCARGILL"},  # Thursday
  17     # "67 Chesney Street": {"address": "67 Chesney Street INVERCARGILL"},  # Friday
  18 }
  19 
  20 ICON_MAP = {
  21     "Glass": "mdi:glass-mug-variant",
  22     "Rubbish": "mdi:delete-empty",
  23     "Recycle": "mdi:recycle",
  24 }
  25 
  26 
  27 class WasteSearchResultsParser(HTMLParser):
  28     def __init__(self):
  29         super().__init__()
  30         self._entries = []
  31         self._wasteType = None
  32         self._withinCollectionDay = False
  33         self._withinType = False
  34 
  35     @property
  36     def entries(self):
  37         return self._entries
  38 
  39     def handle_starttag(self, tag, attrs):
  40         if tag == "span":
  41             d = dict(attrs)
  42             if d.get("class", "").startswith("badge"):
  43                 self._withinType = True
  44 
  45     def handle_data(self, data):
  46         if self._withinType:
  47             self._withinType = False
  48             self._wasteType = data
  49         elif data.startswith("Next Service Date:"):
  50             self._withinCollectionDay = True
  51         elif self._withinCollectionDay:
  52             date = datetime.strptime(data, "%y/%m/%d").date()
  53             if self._wasteType is not None:
  54                 self._entries.append(Collection(date, self._wasteType))
  55             self._withinCollectionDay = False
  56 
  57 
  58 HEADER = {"User-Agent": "Mozilla/5.0"}
  59 
  60 SITE_URL = "https://www.wastenet.org.nz/bin-day/"
  61 ADDRESS_URL = "https://www.wastenet.org.nz/wp-admin/admin-ajax.php"
  62 
  63 
  64 class Source:
  65     def __init__(self, address: str | None = None, entry_id=None):
  66         if not address and not entry_id:
  67             raise ValueError("Address or entry_id must be provided")
  68 
  69         self._address = address.replace(" INVERCARGILL", "") if address else None
  70         self._entry_id = entry_id
  71 
  72     def get_entry_id(self, s):
  73         r = s.get(SITE_URL)
  74         r.raise_for_status()
  75         # regex find security: 'KEY'
  76         match = re.search(r"security: '(\w+)'", r.text)
  77         if not match:
  78             raise ValueError("Security key not found")
  79         security_key = match.group(1)
  80 
  81         # get token
  82         params = {
  83             "action": "we_data_autocomplete",
  84             "term": self._address,
  85             "security": security_key,
  86         }
  87 
  88         r = s.get(
  89             ADDRESS_URL,
  90             params=params,
  91         )
  92         r.raise_for_status()
  93 
  94         return r.json()["data"][0]["url"].split("=")[1]
  95 
  96     def fetch(self):
  97         s = requests.Session()
  98         s.headers.update(HEADER)
  99 
  100         if self._entry_id is None:
  101             self._entry_id = self.get_entry_id(s)
  102 
  103         r = s.get(SITE_URL, params={"entry_id": self._entry_id})
  104         r.raise_for_status()
  105         p = WasteSearchResultsParser()
  106         p.feed(r.text)
  107         return p.entries
  108
  [end of custom_components/waste_collection_schedule/waste_collection_schedule/source/wastenet_org_nz.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/wastenet_org_nz.py b/custom_components/waste_collection_schedule/waste_collection_schedule/source/wastenet_org_nz.py
  --- a/custom_components/waste_collection_schedule/waste_collection_schedule/source/wastenet_org_nz.py
  +++ b/custom_components/waste_collection_schedule/waste_collection_schedule/source/wastenet_org_nz.py
  @@ -49,7 +49,7 @@
           elif data.startswith("Next Service Date:"):
               self._withinCollectionDay = True
           elif self._withinCollectionDay:
  -            date = datetime.strptime(data, "%y/%m/%d").date()
  +            date = datetime.strptime(data, "%d/%m/%y").date()
               if self._wasteType is not None:
                   self._entries.append(Collection(date, self._wasteType))
               self._withinCollectionDay = False
  
verification_info: {"golden_diff": "diff --git a/custom_components/waste_collection_schedule/waste_collection_schedule/source/wastenet_org_nz.py b/custom_components/waste_collection_schedule/waste_collection_schedule/source/wastenet_org_nz.py\n--- a/custom_components/waste_collection_schedule/waste_collection_schedule/source/wastenet_org_nz.py\n+++ b/custom_components/waste_collection_schedule/waste_collection_schedule/source/wastenet_org_nz.py\n@@ -49,7 +49,7 @@\n         elif data.startswith(\"Next Service Date:\"):\n             self._withinCollectionDay = True\n         elif self._withinCollectionDay:\n-            date = datetime.strptime(data, \"%y/%m/%d\").date()\n+            date = datetime.strptime(data, \"%d/%m/%y\").date()\n             if self._wasteType is not None:\n                 self._entries.append(Collection(date, self._wasteType))\n             self._withinCollectionDay = False\n", "issue": "[Bug]: WasteNet Southland not working after 1.46.0\n### I Have A Problem With:\n\nA specific source\n\n### What's Your Problem\n\nThe WasteNet Southland website and url has changed about a month ago. The issue created by this change was supposed to be fixed in 1.46.0, but unfortunately it is still not working.\r\nTested with my address and even with the example data, returning all sensors as unknown.\n\n### Source (if relevant)\n\nwastenet_org_nz\n\n### Logs\n\n```Shell\nno relevant logs\n```\n\n\n### Relevant Configuration\n\n_No response_\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 re\nfrom datetime import datetime\nfrom html.parser import HTMLParser\n\nimport requests\nfrom waste_collection_schedule import Collection  # type: ignore[attr-defined]\n\nTITLE = \"Gore, Invercargill & Southland\"\nDESCRIPTION = \"Source for Wastenet.org.nz.\"\nURL = \"http://www.wastenet.org.nz\"\nTEST_CASES = {\n    \"166 Lewis Street\": {\"address\": \"166 Lewis Street\"},\n    \"Old Format: 199 Crawford Street\": {\"address\": \"199 Crawford Street INVERCARGILL\"},\n    \"Old Format: 156 Tay Street\": {\"address\": \"156 Tay Street INVERCARGILL\"},\n    \"entry_id glass only\": {\"entry_id\": \"23571\"},\n    # \"31 Conyers Street\": {\"address\": \"31 Conyers Street INVERCARGILL\"},  # Thursday\n    # \"67 Chesney Street\": {\"address\": \"67 Chesney Street INVERCARGILL\"},  # Friday\n}\n\nICON_MAP = {\n    \"Glass\": \"mdi:glass-mug-variant\",\n    \"Rubbish\": \"mdi:delete-empty\",\n    \"Recycle\": \"mdi:recycle\",\n}\n\n\nclass WasteSearchResultsParser(HTMLParser):\n    def __init__(self):\n        super().__init__()\n        self._entries = []\n        self._wasteType = None\n        self._withinCollectionDay = False\n        self._withinType = False\n\n    @property\n    def entries(self):\n        return self._entries\n\n    def handle_starttag(self, tag, attrs):\n        if tag == \"span\":\n            d = dict(attrs)\n            if d.get(\"class\", \"\").startswith(\"badge\"):\n                self._withinType = True\n\n    def handle_data(self, data):\n        if self._withinType:\n            self._withinType = False\n            self._wasteType = data\n        elif data.startswith(\"Next Service Date:\"):\n            self._withinCollectionDay = True\n        elif self._withinCollectionDay:\n            date = datetime.strptime(data, \"%y/%m/%d\").date()\n            if self._wasteType is not None:\n                self._entries.append(Collection(date, self._wasteType))\n            self._withinCollectionDay = False\n\n\nHEADER = {\"User-Agent\": \"Mozilla/5.0\"}\n\nSITE_URL = \"https://www.wastenet.org.nz/bin-day/\"\nADDRESS_URL = \"https://www.wastenet.org.nz/wp-admin/admin-ajax.php\"\n\n\nclass Source:\n    def __init__(self, address: str | None = None, entry_id=None):\n        if not address and not entry_id:\n            raise ValueError(\"Address or entry_id must be provided\")\n\n        self._address = address.replace(\" INVERCARGILL\", \"\") if address else None\n        self._entry_id = entry_id\n\n    def get_entry_id(self, s):\n        r = s.get(SITE_URL)\n        r.raise_for_status()\n        # regex find security: 'KEY'\n        match = re.search(r\"security: '(\\w+)'\", r.text)\n        if not match:\n            raise ValueError(\"Security key not found\")\n        security_key = match.group(1)\n\n        # get token\n        params = {\n            \"action\": \"we_data_autocomplete\",\n            \"term\": self._address,\n            \"security\": security_key,\n        }\n\n        r = s.get(\n            ADDRESS_URL,\n            params=params,\n        )\n        r.raise_for_status()\n\n        return r.json()[\"data\"][0][\"url\"].split(\"=\")[1]\n\n    def fetch(self):\n        s = requests.Session()\n        s.headers.update(HEADER)\n\n        if self._entry_id is None:\n            self._entry_id = self.get_entry_id(s)\n\n        r = s.get(SITE_URL, params={\"entry_id\": self._entry_id})\n        r.raise_for_status()\n        p = WasteSearchResultsParser()\n        p.feed(r.text)\n        return p.entries\n", "path": "custom_components/waste_collection_schedule/waste_collection_schedule/source/wastenet_org_nz.py"}]}