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