Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change wuerzburg_de to ICS #3122

Merged
merged 2 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,8 @@ If your service provider is not listed, feel free to open a [source request issu
- [Abfallkalender Mannheim](/doc/source/insert_it_de.md) / insert-it.de/BmsAbfallkalenderMannheim
- [Abfallkalender Offenbach](/doc/source/insert_it_de.md) / insert-it.de/BmsAbfallkalenderOffenbach
- [Abfallkalender Offenbach am Main (deprecated)](/doc/source/offenbach_de.md) / offenbach.de
- [Abfallkalender Würzburg](/doc/source/wuerzburg_de.md) / wuerzburg.de
- [Abfallkalender Würzburg (deprecated)](/doc/source/wuerzburg_de.md) / wuerzburg.de
- [Abfallkalender Würzburg (ICS)](/doc/ics/wuerzburg_de.md) / wuerzburg.de
- [AbfallNavi (RegioIT.de)](/doc/source/abfallnavi_de.md) / regioit.de
- [Abfalltermine Forchheim](/doc/source/abfalltermine_forchheim_de.md) / abfalltermine-forchheim.de
- [Abfallwirtschaft Alb-Donau-Kreis](/doc/source/buergerportal_de.md) / aw-adk.de
Expand Down
8 changes: 7 additions & 1 deletion custom_components/waste_collection_schedule/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -4201,11 +4201,17 @@
"id": "offenbach_de"
},
{
"title": "Abfallkalender W\u00fcrzburg",
"title": "Abfallkalender W\u00fcrzburg (deprecated)",
"module": "wuerzburg_de",
"default_params": {},
"id": "wuerzburg_de"
},
{
"title": "Abfallkalender W\u00fcrzburg (ICS)",
"module": "ics",
"default_params": {},
"id": "ics_wuerzburg_de"
},
{
"title": "AbfallNavi (RegioIT.de)",
"module": "abfallnavi_de",
Expand Down
42 changes: 42 additions & 0 deletions custom_components/waste_collection_schedule/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -3224,6 +3224,48 @@
},
"data_description": {}
},
"args_ics_wuerzburg_de": {
"title": "Quelle konfigurieren",
"description": "Konfiguriere deinen Service Provider. \n\n- Besuchen Sie https://www.wuerzburg.de/themen/umwelt-klima/abfall-und-stadtreinigung/abfallkalender und wählen Sie Ihre Straße.\n- Klicken Sie auf \"Kalender als ICS\"\n- Klicken Sie mit der rechten Maustaste auf \"Download\" und wählen Sie \"Adresse des Links kopieren\"\n- Verwenden Sie diesen Link als URL-Parameter\n\n\nMehr details: https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/ics/wuerzburg_de.md",
"data": {
"calendar_title": "Kalender Titel",
"file": "Datei",
"headers": "Headers",
"method": "Methode",
"offset": "Offset",
"params": "Parameter",
"regex": "Regulärer Ausdruck",
"split_at": "Trennen bei",
"title_template": "Titelvorlage",
"url": "URL",
"verify_ssl": "SSL-Verifizierung aktivieren",
"version": "Version",
"year_field": "Jahresfeld"
},
"data_description": {
"calendar_title": "Ein lesbarerer oder benutzerfreundlicherer Name für den Müllkalender. Wenn nichts angegeben wird, wird der Name der Quelle verwendet."
}
},
"reconfigure_ics_wuerzburg_de": {
"title": "Quelle Neu Konfigurieren",
"description": "Konfiguriere deinen Service Provider. \n\n- Besuchen Sie https://www.wuerzburg.de/themen/umwelt-klima/abfall-und-stadtreinigung/abfallkalender und wählen Sie Ihre Straße.\n- Klicken Sie auf \"Kalender als ICS\"\n- Klicken Sie mit der rechten Maustaste auf \"Download\" und wählen Sie \"Adresse des Links kopieren\"\n- Verwenden Sie diesen Link als URL-Parameter\n\n\nMehr details: https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/ics/wuerzburg_de.md",
"data": {
"calendar_title": "Kalender Titel",
"file": "Datei",
"headers": "Headers",
"method": "Methode",
"offset": "Offset",
"params": "Parameter",
"regex": "Regulärer Ausdruck",
"split_at": "Trennen bei",
"title_template": "Titelvorlage",
"url": "URL",
"verify_ssl": "SSL-Verifizierung aktivieren",
"version": "Version",
"year_field": "Jahresfeld"
},
"data_description": {}
},
"args_abfallnavi_de": {
"title": "Quelle konfigurieren",
"description": "Konfiguriere deinen Service Provider. Mehr details: https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/abfallnavi_de.md",
Expand Down
42 changes: 42 additions & 0 deletions custom_components/waste_collection_schedule/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3230,6 +3230,48 @@
},
"data_description": {}
},
"args_ics_wuerzburg_de": {
"title": "Configure Source",
"description": "Configure your service provider. \n\n- Visit https://www.wuerzburg.de/themen/umwelt-klima/abfall-und-stadtreinigung/abfallkalender and select your street.\n- Click on \"Calendar as ICS\"\n- Right-lick on \"Download\" and select \"Copy link address\"\n- Use this link as URL parameter\n\n\nMore details: https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/ics/wuerzburg_de.md.",
"data": {
"calendar_title": "Calendar Title",
"file": "File",
"headers": "Headers",
"method": "Method",
"offset": "Offset",
"params": "Parameters",
"regex": "Regex",
"split_at": "Split At",
"title_template": "Title Template",
"url": "Url",
"verify_ssl": "Verify Ssl",
"version": "Version",
"year_field": "Year Field"
},
"data_description": {
"calendar_title": "A more readable, or user-friendly, name for the waste calendar. If nothing is provided, the name returned by the source will be used."
}
},
"reconfigure_ics_wuerzburg_de": {
"title": "Reconfigure Source",
"description": "Configure your service provider. \n\n- Visit https://www.wuerzburg.de/themen/umwelt-klima/abfall-und-stadtreinigung/abfallkalender and select your street.\n- Click on \"Calendar as ICS\"\n- Right-lick on \"Download\" and select \"Copy link address\"\n- Use this link as URL parameter\n\n\nMore details: https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/ics/wuerzburg_de.md.",
"data": {
"calendar_title": "Calendar Title",
"file": "File",
"headers": "Headers",
"method": "Method",
"offset": "Offset",
"params": "Parameters",
"regex": "Regex",
"split_at": "Split At",
"title_template": "Title Template",
"url": "Url",
"verify_ssl": "Verify Ssl",
"version": "Version",
"year_field": "Year Field"
},
"data_description": {}
},
"args_abfallnavi_de": {
"title": "Configure Source",
"description": "Configure your service provider. More details: https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/abfallnavi_de.md.",
Expand Down
42 changes: 42 additions & 0 deletions custom_components/waste_collection_schedule/translations/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -3224,6 +3224,48 @@
},
"data_description": {}
},
"args_ics_wuerzburg_de": {
"title": "Configurazione Sorgente",
"description": "Compila i campi per ottenere le informazioni sul tuo servizio di raccolta. \n\n- Visit https://www.wuerzburg.de/themen/umwelt-klima/abfall-und-stadtreinigung/abfallkalender and select your street.\n- Click on \"Calendar as ICS\"\n- Right-lick on \"Download\" and select \"Copy link address\"\n- Use this link as URL parameter\n\n\nMaggiori informazioni: https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/ics/wuerzburg_de.md.",
"data": {
"calendar_title": "Nome Calendario",
"file": "Nome File",
"headers": "Headers",
"method": "Metodo",
"offset": "Offset",
"params": "Parametri",
"regex": "Regex",
"split_at": "Split At",
"title_template": "Title Template",
"url": "Url",
"verify_ssl": "Verifica SSL",
"version": "Versione",
"year_field": "Year Field"
},
"data_description": {
"calendar_title": "Puoi cambiare il nome del calendario della raccolta dei rifiuti, altrimenti di default verra' utilizzato il nome del tuo fornitore di servizi."
}
},
"reconfigure_ics_wuerzburg_de": {
"title": "Riconfigurazione Sorgente",
"description": "Compila i campi per ottenere le informazioni sul tuo servizio di raccolta. \n\n- Visit https://www.wuerzburg.de/themen/umwelt-klima/abfall-und-stadtreinigung/abfallkalender and select your street.\n- Click on \"Calendar as ICS\"\n- Right-lick on \"Download\" and select \"Copy link address\"\n- Use this link as URL parameter\n\n\nPer maggiori informazioni: https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/ics/wuerzburg_de.md.",
"data": {
"calendar_title": "Nome Calendario",
"file": "Nome File",
"headers": "Headers",
"method": "Metodo",
"offset": "Offset",
"params": "Parametri",
"regex": "Regex",
"split_at": "Split At",
"title_template": "Title Template",
"url": "Url",
"verify_ssl": "Verifica SSL",
"version": "Versione",
"year_field": "Year Field"
},
"data_description": {}
},
"args_abfallnavi_de": {
"title": "Configurazione Sorgente",
"description": "Compila i campi per ottenere le informazioni sul tuo servizio di raccolta. Maggiori informazioni: https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/abfallnavi_de.md.",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import datetime
import logging

import requests
from bs4 import BeautifulSoup
Expand All @@ -8,8 +9,9 @@
SourceArgumentNotFoundWithSuggestions,
)

TITLE = "Abfallkalender Würzburg"
DESCRIPTION = "Source for waste collection in the city of Würzburg, Germany."
LOGGER = logging.getLogger(__name__)
TITLE = "Abfallkalender Würzburg (deprecated)"
DESCRIPTION = "Deprecated: Use the ICS source instead. Source for waste collection in the city of Würzburg, Germany."
URL = "https://www.wuerzburg.de"
TEST_CASES = {
"District only": {"district": "Altstadt"},
Expand Down Expand Up @@ -82,6 +84,11 @@ def map_district_id(district: str | None = None, street: str | None = None):
)

def fetch(self):
LOGGER.warning(
"The Abfallkalender Würzburg source is deprecated and might not work with all addresses anymore."
" Please use the ICS source instead: https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/ics/wuerzburg_de.md"
)

# Get & parse full HTML only on first call to fetch() to map district or street to district_id
if not self._district_id:
self._district_id = self.map_district_id(self._district, self._street)
Expand Down
32 changes: 32 additions & 0 deletions doc/ics/wuerzburg_de.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Abfallkalender Würzburg (ICS)

Abfallkalender Würzburg (ICS) is supported by the generic [ICS](/doc/source/ics.md) source. For all available configuration options, please refer to the source description.


## How to get the configuration arguments

- Visit <https://www.wuerzburg.de/themen/umwelt-klima/abfall-und-stadtreinigung/abfallkalender> and select your street.
- Click on "Calendar as ICS"
- Right-lick on "Download" and select "Copy link address"
- Use this link as URL parameter

## Examples

### Residenzplatz

```yaml
waste_collection_schedule:
sources:
- name: ics
args:
url: https://www.wuerzburg.de/themen/umwelt-klima/abfall-und-stadtreinigung/abfallkalender/ics?ev[addr]=19935
```
### Friedrich-Ebert-Ring ab 13

```yaml
waste_collection_schedule:
sources:
- name: ics
args:
url: https://www.wuerzburg.de/themen/umwelt-klima/abfall-und-stadtreinigung/abfallkalender/ics?ev[addr]=19943
```
18 changes: 18 additions & 0 deletions doc/ics/yaml/wuerzburg_de.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
title: Abfallkalender Würzburg (ICS)
url: https://www.wuerzburg.de
howto:
en: |
- Visit <https://www.wuerzburg.de/themen/umwelt-klima/abfall-und-stadtreinigung/abfallkalender> and select your street.
- Click on "Calendar as ICS"
- Right-lick on "Download" and select "Copy link address"
- Use this link as URL parameter
de: |
- Besuchen Sie <https://www.wuerzburg.de/themen/umwelt-klima/abfall-und-stadtreinigung/abfallkalender> und wählen Sie Ihre Straße.
- Klicken Sie auf "Kalender als ICS"
- Klicken Sie mit der rechten Maustaste auf "Download" und wählen Sie "Adresse des Links kopieren"
- Verwenden Sie diesen Link als URL-Parameter
test_cases:
Residenzplatz:
url: https://www.wuerzburg.de/themen/umwelt-klima/abfall-und-stadtreinigung/abfallkalender/ics?ev[addr]=19935
Friedrich-Ebert-Ring ab 13:
url: https://www.wuerzburg.de/themen/umwelt-klima/abfall-und-stadtreinigung/abfallkalender/ics?ev[addr]=19943
1 change: 1 addition & 0 deletions doc/source/ics.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ This source has been successfully tested with the following service providers:
- [Abfall App](/doc/ics/abfall_app_net.md) / abfall-app.net
- [Abfall IO ICS Version](/doc/ics/abfall_io_ics.md) / abfallplus.de
- [Abfallentsorgung Kreis Kassel](/doc/ics/abfall_kreis_kassel_de.md) / abfall-kreis-kassel.de
- [Abfallkalender Würzburg (ICS)](/doc/ics/wuerzburg_de.md) / wuerzburg.de
- [Abfallwirtschaft Dithmarschen (AWD)](/doc/ics/awd_online_de.md) / awd-online.de
- [Abfallwirtschaft Enzkreis](/doc/ics/entsorgung_regional_de.md) / entsorgung-regional.de
- [Abfallwirtschaft Freiburg](/doc/ics/abfallwirtschaft_freiburg_de.md) / abfall-eglz.de
Expand Down
6 changes: 5 additions & 1 deletion doc/source/wuerzburg_de.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Abfallkalender Würzburg
# Abfallkalender Würzburg (deprecated)

Please use the [ICS source](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/ics/wuerzburg_de.md) instead.

---

Support for schedules provided by [Abfallkalender Würzburg](https://www.wuerzburg.de/themen/umwelt-verkehr/vorsorge-entsorgung/abfallkalender/32208.Abfallkalender.html), serving the City of Würzburg.

Expand Down
Loading