From d5b3c0f4aee2c6fa244cdb38770207b8db6315e6 Mon Sep 17 00:00:00 2001 From: Rene Nulsch <33263735+ReneNulschDE@users.noreply.github.com> Date: Wed, 30 Oct 2024 15:03:58 +0100 Subject: [PATCH] =?UTF-8?q?Fix:=20GFA=20L=C3=BCneburg=20-=20set=20house=20?= =?UTF-8?q?number=20correctly=20(#2946)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add Streetchanged request * Fix test case description * fix - Doc issues --- .../source/gfa_lueneburg_de.py | 20 +++++++++++++------ doc/source/gfa_lueneburg_de.md | 17 ++++++++-------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/custom_components/waste_collection_schedule/waste_collection_schedule/source/gfa_lueneburg_de.py b/custom_components/waste_collection_schedule/waste_collection_schedule/source/gfa_lueneburg_de.py index 78356bda0..9218858ef 100644 --- a/custom_components/waste_collection_schedule/waste_collection_schedule/source/gfa_lueneburg_de.py +++ b/custom_components/waste_collection_schedule/waste_collection_schedule/source/gfa_lueneburg_de.py @@ -10,7 +10,7 @@ DESCRIPTION = "Source for GFA Lüneburg." URL = "https://www.gfa-lueneburg.de/" TEST_CASES = { - "Andervenne Am Gallenberg": { + "Dahlem Hauptstr. 7": { "city": "Dahlem", "street": "Hauptstr.", "house_number": 7, @@ -82,8 +82,6 @@ def fetch(self): ) r.raise_for_status() r.encoding = "utf-8" - with open("test1.html", "w") as f: - f.write(r.text) parser = HiddenInputParser() parser.feed(r.text) @@ -101,6 +99,16 @@ def fetch(self): ) r.raise_for_status() + args = parser.args + args["Ort"] = self._city + args["Strasse"] = self._street + args["Hausnummer"] = str(self._hnr) + args["Method"] = "POST" + args["SubmitAction"] = "STREETCHANGED" + args["Focus"] = "Strasse" + r = session.post(SERVLET, data=args) + r.raise_for_status() + args["SubmitAction"] = "forward" r = session.post( SERVLET, @@ -108,9 +116,9 @@ def fetch(self): ) r.raise_for_status() - args[ - "ApplicationName" - ] = "com.athos.kd.lueneburg.WasteDisposalServicesBusinessCase" + args["ApplicationName"] = ( + "com.athos.kd.lueneburg.WasteDisposalServicesBusinessCase" + ) args["SubmitAction"] = "filedownload_ICAL" args["IsLastPage"] = "true" args["Method"] = "POST" diff --git a/doc/source/gfa_lueneburg_de.md b/doc/source/gfa_lueneburg_de.md index a827592b5..e552ebe11 100644 --- a/doc/source/gfa_lueneburg_de.md +++ b/doc/source/gfa_lueneburg_de.md @@ -1,13 +1,13 @@ -# Abfallwirtschaftsbetrieb Emsland +# GFA Lüneburg -Support for schedules provided by [Emsland Abfallwirtschaftsbetrieb](https://www.awb-emsland.de/), Germany. +Support for schedules provided by [GFA Lüneburg](https://www.gfa-lueneburg.de/service/abfuhrkalender.html), Germany. ## Configuration via configuration.yaml ```yaml waste_collection_schedule: sources: - - name: awb_emsland_de + - name: gfa_lueneburg_de args: city: CITY street: STREET @@ -17,21 +17,20 @@ waste_collection_schedule: ### Configuration Variables **city** -*(string) (required)* +_(string) (required)_ **street** -*(string) (required)* +_(string) (required)_ **house_number** -*(integer) (required)* - +_(integer) (required)_ ## Example ```yaml waste_collection_schedule: sources: - - name: awb_emsland_de + - name: gfa_lueneburg_de args: city: "Dahlem" street: "Hauptstr" @@ -41,7 +40,7 @@ waste_collection_schedule: ```yaml waste_collection_schedule: sources: - - name: awb_emsland_de + - name: gfa_lueneburg_de args: city: Wendish Evern street: Kückenbrook