From 74a7946f2f7c1c503d457e3d48adb822b6d528be Mon Sep 17 00:00:00 2001 From: Robert Marsal Date: Thu, 26 Dec 2024 20:10:23 +0000 Subject: [PATCH 1/2] fix: Merton UK has changed the format of the dates Also updated the test cases as they don't seem to be valid IDs any more. --- .../waste_collection_schedule/source/merton_gov_uk.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/waste_collection_schedule/waste_collection_schedule/source/merton_gov_uk.py b/custom_components/waste_collection_schedule/waste_collection_schedule/source/merton_gov_uk.py index 263a2ed5b..22f1577a3 100644 --- a/custom_components/waste_collection_schedule/waste_collection_schedule/source/merton_gov_uk.py +++ b/custom_components/waste_collection_schedule/waste_collection_schedule/source/merton_gov_uk.py @@ -11,8 +11,8 @@ URL = "https://www.merton.gov.uk/" TEST_CASES = { - "test 1": {"property": "28186366"}, - "test 2": {"property": "28166100"}, + "test 1": {"property": "25884617"}, + "test 2": {"property": "25861170"} } API_URL = "https://myneighbourhood.merton.gov.uk/Wasteservices/WasteServices.aspx" @@ -66,7 +66,7 @@ def fetch(self): # Add data to the main JSON Wrapper entries.append( Collection( - date=datetime.strptime(collectionDate, "%d %B %Y").date(), + date=datetime.strptime(collectionDate, "%A %d %B %Y").date(), t=title, icon=ICON_MAP.get(title), ) From d9a9ba3477873583f7fb26408b22cbd200e8eb82 Mon Sep 17 00:00:00 2001 From: 5ila5 <5ila5@users.noreply.github.com> Date: Fri, 27 Dec 2024 00:09:20 +0100 Subject: [PATCH 2/2] reformatting + fixing old typo --- .../waste_collection_schedule/source/merton_gov_uk.py | 2 +- doc/source/merton_gov_uk.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/waste_collection_schedule/waste_collection_schedule/source/merton_gov_uk.py b/custom_components/waste_collection_schedule/waste_collection_schedule/source/merton_gov_uk.py index 22f1577a3..1a7d4c5d3 100644 --- a/custom_components/waste_collection_schedule/waste_collection_schedule/source/merton_gov_uk.py +++ b/custom_components/waste_collection_schedule/waste_collection_schedule/source/merton_gov_uk.py @@ -12,7 +12,7 @@ TEST_CASES = { "test 1": {"property": "25884617"}, - "test 2": {"property": "25861170"} + "test 2": {"property": "25861170"}, } API_URL = "https://myneighbourhood.merton.gov.uk/Wasteservices/WasteServices.aspx" diff --git a/doc/source/merton_gov_uk.md b/doc/source/merton_gov_uk.md index e128cdaca..e9324577b 100644 --- a/doc/source/merton_gov_uk.md +++ b/doc/source/merton_gov_uk.md @@ -21,7 +21,7 @@ Unique number the London Borough of Merton uses to identify your property. #### How to find your `PROPERTY_ID` -Serach for your waste collection schedule at (https://myneighbourhood.merton.gov.uk/Wasteservices/WasteServicesSearch.aspx). Your `PROPERTY_ID` is the set of numbers at the end of the url when your schedule is being displayed. +Search for your waste collection schedule at (https://myneighbourhood.merton.gov.uk/Wasteservices/WasteServicesSearch.aspx). Your `PROPERTY_ID` is the set of numbers at the end of the url when your schedule is being displayed. For example: myneighbourhood.merton.gov.uk/Wasteservices/WasteServices.aspx?ID=`28166109`