diff --git a/README.md b/README.md index 89854522..1a839ab0 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/custom_components/waste_collection_schedule/waste_collection_schedule/source/geoport_nwm_de.py b/custom_components/waste_collection_schedule/waste_collection_schedule/source/geoport_nwm_de.py index 507eae5f..88fbb716 100644 --- a/custom_components/waste_collection_schedule/waste_collection_schedule/source/geoport_nwm_de.py +++ b/custom_components/waste_collection_schedule/waste_collection_schedule/source/geoport_nwm_de.py @@ -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) diff --git a/doc/source/geoport_nwm_de.md b/doc/source/geoport_nwm_de.md new file mode 100644 index 00000000..80d012e3 --- /dev/null +++ b/doc/source/geoport_nwm_de.md @@ -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. \ No newline at end of file diff --git a/info.md b/info.md index 0d305f22..a955c65c 100644 --- a/info.md +++ b/info.md @@ -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)