Skip to content

Commit d5b3c0f

Browse files
authored
Fix: GFA Lüneburg - set house number correctly (#2946)
* Add Streetchanged request * Fix test case description * fix - Doc issues
1 parent 23ef38f commit d5b3c0f

File tree

2 files changed

+22
-15
lines changed

2 files changed

+22
-15
lines changed

custom_components/waste_collection_schedule/waste_collection_schedule/source/gfa_lueneburg_de.py

+14-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
DESCRIPTION = "Source for GFA Lüneburg."
1111
URL = "https://www.gfa-lueneburg.de/"
1212
TEST_CASES = {
13-
"Andervenne Am Gallenberg": {
13+
"Dahlem Hauptstr. 7": {
1414
"city": "Dahlem",
1515
"street": "Hauptstr.",
1616
"house_number": 7,
@@ -82,8 +82,6 @@ def fetch(self):
8282
)
8383
r.raise_for_status()
8484
r.encoding = "utf-8"
85-
with open("test1.html", "w") as f:
86-
f.write(r.text)
8785

8886
parser = HiddenInputParser()
8987
parser.feed(r.text)
@@ -101,16 +99,26 @@ def fetch(self):
10199
)
102100
r.raise_for_status()
103101

102+
args = parser.args
103+
args["Ort"] = self._city
104+
args["Strasse"] = self._street
105+
args["Hausnummer"] = str(self._hnr)
106+
args["Method"] = "POST"
107+
args["SubmitAction"] = "STREETCHANGED"
108+
args["Focus"] = "Strasse"
109+
r = session.post(SERVLET, data=args)
110+
r.raise_for_status()
111+
104112
args["SubmitAction"] = "forward"
105113
r = session.post(
106114
SERVLET,
107115
data=args,
108116
)
109117
r.raise_for_status()
110118

111-
args[
112-
"ApplicationName"
113-
] = "com.athos.kd.lueneburg.WasteDisposalServicesBusinessCase"
119+
args["ApplicationName"] = (
120+
"com.athos.kd.lueneburg.WasteDisposalServicesBusinessCase"
121+
)
114122
args["SubmitAction"] = "filedownload_ICAL"
115123
args["IsLastPage"] = "true"
116124
args["Method"] = "POST"

doc/source/gfa_lueneburg_de.md

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# Abfallwirtschaftsbetrieb Emsland
1+
# GFA Lüneburg
22

3-
Support for schedules provided by [Emsland Abfallwirtschaftsbetrieb](https://www.awb-emsland.de/), Germany.
3+
Support for schedules provided by [GFA Lüneburg](https://www.gfa-lueneburg.de/service/abfuhrkalender.html), Germany.
44

55
## Configuration via configuration.yaml
66

77
```yaml
88
waste_collection_schedule:
99
sources:
10-
- name: awb_emsland_de
10+
- name: gfa_lueneburg_de
1111
args:
1212
city: CITY
1313
street: STREET
@@ -17,21 +17,20 @@ waste_collection_schedule:
1717
### Configuration Variables
1818
1919
**city**
20-
*(string) (required)*
20+
_(string) (required)_
2121
2222
**street**
23-
*(string) (required)*
23+
_(string) (required)_
2424
2525
**house_number**
26-
*(integer) (required)*
27-
26+
_(integer) (required)_
2827
2928
## Example
3029
3130
```yaml
3231
waste_collection_schedule:
3332
sources:
34-
- name: awb_emsland_de
33+
- name: gfa_lueneburg_de
3534
args:
3635
city: "Dahlem"
3736
street: "Hauptstr"
@@ -41,7 +40,7 @@ waste_collection_schedule:
4140
```yaml
4241
waste_collection_schedule:
4342
sources:
44-
- name: awb_emsland_de
43+
- name: gfa_lueneburg_de
4544
args:
4645
city: Wendish Evern
4746
street: Kückenbrook

0 commit comments

Comments
 (0)