mirror of
https://github.com/sascha-hemi/hacs_waste_collection_schedule.git
synced 2026-03-21 04:06:03 +01:00
Merge pull request #1288 from 5ila5/fix_c_trace_gemeinde_param
fix c_trace_de: add gemeinde param needed for some municipalities
This commit is contained in:
@@ -54,6 +54,13 @@ TEST_CASES = {
|
||||
"hausnummer": 3,
|
||||
"service": "grossgeraulandkreis-abfallkalender",
|
||||
},
|
||||
"Aurich Kirchdorf": {
|
||||
"ort": "Kirchdorf",
|
||||
"gemeinde": "Aurich",
|
||||
"strasse": "Am Reidigermeer",
|
||||
"hausnummer": "2d/e",
|
||||
"service": "aurich-abfallkalender",
|
||||
},
|
||||
}
|
||||
|
||||
DEFAULT_SUBDOMAIN = "web"
|
||||
@@ -149,7 +156,9 @@ BASE_URL = "https://{subdomain}.c-trace.de"
|
||||
|
||||
|
||||
class Source:
|
||||
def __init__(self, strasse, hausnummer, ort="", ortsteil="", service=None):
|
||||
def __init__(
|
||||
self, strasse, hausnummer, gemeinde="", ort="", ortsteil="", service=None
|
||||
):
|
||||
# Compatibility handling for Bremen which was the first supported
|
||||
# district and didn't require to set a service name.
|
||||
if service is None:
|
||||
@@ -171,6 +180,9 @@ class Source:
|
||||
|
||||
self._service = service
|
||||
self._ort = ort
|
||||
if not gemeinde:
|
||||
gemeinde = ort
|
||||
self._gemeinde = gemeinde
|
||||
self._ortsteil = ortsteil
|
||||
self._strasse = strasse
|
||||
self._hausnummer = hausnummer
|
||||
@@ -195,7 +207,7 @@ class Source:
|
||||
|
||||
args = {
|
||||
"Ort": self._ort,
|
||||
"Gemeinde": self._ort,
|
||||
"Gemeinde": self._gemeinde,
|
||||
"Strasse": self._strasse,
|
||||
"Hausnr": self._hausnummer,
|
||||
"Abfall": "|".join(str(i) for i in range(0, 99)), # return all waste types
|
||||
|
||||
@@ -11,6 +11,7 @@ waste_collection_schedule:
|
||||
args:
|
||||
service: SERVICE
|
||||
ort: ORT
|
||||
gemeinde: GEMEINDE
|
||||
ortsteil: ORTSTEIL
|
||||
strasse: STRASSE
|
||||
hausnummer: HAUSNUMMER
|
||||
@@ -26,6 +27,10 @@ Name of the service which is specific to your municipality. See the table below
|
||||
*(string) (optional)*
|
||||
Needed for most municipalities but no all
|
||||
|
||||
**ort**
|
||||
*(string) (optional)*
|
||||
Needed for some municipalities but no all (can be left empty if same as ort)
|
||||
|
||||
**ortsteil**
|
||||
*(string) (optional)*
|
||||
Needed only for some municipalities but no all
|
||||
@@ -71,6 +76,18 @@ waste_collection_schedule:
|
||||
service: landau
|
||||
```
|
||||
|
||||
```yaml
|
||||
waste_collection_schedule:
|
||||
sources:
|
||||
- name: c_trace_de
|
||||
args:
|
||||
strasse: Am Reidigermeer
|
||||
hausnummer: 2d/e
|
||||
service: aurich-abfallkalender
|
||||
gemeinde: Aurich
|
||||
ort: Kirchdorf
|
||||
```
|
||||
|
||||
## How to get the source arguments
|
||||
|
||||
This source requires the name of a `service` which is specific to your municipality. Use the following map to get the right value for your district.
|
||||
@@ -105,4 +122,4 @@ Link for above image: https://web.c-trace.de/segebergwzv-abfallkalender/(S(ebi2z
|
||||
|
||||
From this Link you can extract the following parameters:
|
||||
|
||||
`web|app`.c-trace.de/`(web.)service`/some-id/abfallkalender/`cal|downloadcal`/year?Ort=`ort`&Ortsteil=`ortsteil`&Strasse=`strasse`&Hausnr=`hausnummer`...
|
||||
`web|app`.c-trace.de/`(web.)service`/some-id/abfallkalender/`cal|downloadcal` `/year|`?Ort=`ort`&Ortsteil=`ortsteil`&Strasse=`strasse`&Hausnr=`hausnummer`...
|
||||
|
||||
Reference in New Issue
Block a user