Finish Source Nordwestmecklenburg

This commit is contained in:
Finn Freitag
2022-12-26 21:26:53 +01:00
parent f988a923c1
commit f1ea1c8bb1
4 changed files with 29 additions and 9 deletions

View File

@@ -118,6 +118,7 @@ Currently the following service providers are supported:
- [Cochem-Zell](./doc/source/buergerportal_de.md)
- [EGN-Abfallkalender.de](./doc/source/egn_abfallkalender_de.md)
- [Erlangen-Höchstadt](./doc/source/erlangen_hoechstadt_de.md)
- [Geodatenportal Nordwestmecklenburg](./doc/source/geoport_nwm_de.md)
- [Jumomind.de](./doc/source/jumomind_de.md)
- [KAEV Niederlausitz](./doc/source/kaev_niederlausitz_de.md)
- [KWB-Goslar.de](./doc/source/kwb_goslar_de.md)

View File

@@ -9,13 +9,10 @@ DESCRIPTION = "Source for Landkreis Nordwestmecklenburg"
URL = "https://www.geoport-nwm.de/de/abfuhrtermine-geoportal.html"
TEST_CASES = {
"Rüting": {"district": "Rüting"},
# Ortsteil_Rueting
"Grevenstein u.": {"district": "Grevenstein u. Ausbau"},
# Ortsteil_Grevenstein_u_Ausbau
"Grevenstein u. ...": {"district": "Grevenstein u. Ausbau"},
"Seefeld": {"district": "Seefeld/ Testorf- Steinfort"},
# Ortsteil_Seefeld_Testorf_Steinfort
"1100l": {"district": "Groß Stieten (1.100 l Behälter)"}
# Ortsteil_Gross_Stieten_1100_l
"1100l": {"district": "Groß Stieten (1.100 l Behälter)"},
"kl. Bünsdorf": {"district": "Klein Bünsdorf"}
}
@@ -27,10 +24,9 @@ class Source:
def fetch(self):
arg = convert_to_arg(self._district)
today = datetime.date.today()
year = today.year
year = 2023 #today.year
r = requests.get(
f"https://www.geoport-nwm.de/nwm-download/Abfuhrtermine/ICS/{year}/{arg}.ics")
dates = self._ics.convert(r.text)
entries = []
@@ -46,7 +42,7 @@ def convert_to_arg(district):
district = district.replace("ä", "ae")
district = district.replace("ß", "ss")
district = district.replace("/", "")
district = district.replace("-", "")
district = district.replace("- ", "-")
district = district.replace(".", "")
district = district.replace(" ", "_")
arg = urllib.parse.quote("Ortsteil_" + district)

View File

@@ -0,0 +1,22 @@
# Landkreis Nordwestmecklenburg
Support for Landkreis Nordwestmecklenburg in Mecklenburg-Vorpommern, Germany.
## Configuration via configuration.yaml
```yaml
waste_collection_schedule:
sources:
- name: geoport_nwm_de
args:
district: DISTRICT
```
### Configuration Variables
**district**
*(string) (required)*
### How to get the source arguments
Visit [geoport-nwm.de](https://www.geoport-nwm.de/de/abfuhrtermine-geoportal.html) and search for your area. Copy the value from the text input field and use it for the `district` argument. It is case sensitive.

View File

@@ -103,6 +103,7 @@ Currently the following service providers are supported:
- [Cochem-Zell](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/buergerportal_de.md)
- [EGN-Abfallkalender.de](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/egn_abfallkalender_de.md)
- [Erlangen-Höchstadt](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/erlangen_hoechstadt_de.md)
- [Geodatenportal Nordwestmecklenburg](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/geoport_nwm_de.md)
- [Jumomind.de](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/jumomind_de.md)
- [KWB-Goslar.de](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/kwb_goslar_de.md)
- [KWU-Entsorgung.de](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/kwu_de.md)