From c990a6604710ced7215f612920d0547e7d712aab Mon Sep 17 00:00:00 2001 From: 5ila5 <5ila5@users.noreply.github.com> Date: Fri, 18 Oct 2024 12:15:01 +0200 Subject: [PATCH] fix app_my_localca_services_au may fail for some addresses --- .../source/app_my_local_services_au.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/custom_components/waste_collection_schedule/waste_collection_schedule/source/app_my_local_services_au.py b/custom_components/waste_collection_schedule/waste_collection_schedule/source/app_my_local_services_au.py index c3680507d..51ff01449 100644 --- a/custom_components/waste_collection_schedule/waste_collection_schedule/source/app_my_local_services_au.py +++ b/custom_components/waste_collection_schedule/waste_collection_schedule/source/app_my_local_services_au.py @@ -20,6 +20,10 @@ "lat": "-37.824624961239614", "lon": "140.77720893956482", }, + "-35.082943, 138.883702": { + "lat": "-35.082943", + "lon": "138.883702", + }, } EXTRA_INFO = [ # list from https://www.localcouncils.sa.gov.au/my-local-services-app#accordion__target-1426969-2 @@ -178,15 +182,17 @@ def fetch(self) -> list[Collection]: ) ] if additionals_str: - for additional_str in additionals_str.split(", "): + for additional_str in additionals_str.split(","): dates.append( - datetime.strptime(additional_str, "%Y-%m-%d").date() + datetime.strptime(additional_str.strip(), "%Y-%m-%d").date() ) if exclusions_str: - for exclusion_str in exclusions_str.split(", "): + for exclusion_str in exclusions_str.split(","): try: dates.remove( - datetime.strptime(exclusion_str, "%Y-%m-%d").date() + datetime.strptime( + exclusion_str.strip(), "%Y-%m-%d" + ).date() ) except ValueError: print("Exclusion date not found in dates", exclusion_str)