Skip to content

Commit

Permalink
added option to select waste type for awn_de
Browse files Browse the repository at this point in the history
added corresponding translations
  • Loading branch information
GyroGearl00se committed Jan 16, 2025
1 parent fcfb830 commit fd4b212
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 19 deletions.
18 changes: 16 additions & 2 deletions custom_components/waste_collection_schedule/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -4031,7 +4031,14 @@
"address_suffix": "Hausnummerzusatz",
"city": "Ort",
"house_number": "Hausnummer",
"street": "Straße"
"street": "Straße",
"restmuell": "Restmuell",
"bioenergietonne": "Bioenergietonne",
"altpapier_papiertonne": "Altpapier, Papiertonne",
"altpapier_buendelsammlung": "Altpapier, Buendelsammlung",
"verpackungstonne": "Verpackungstonne",
"altkleider_schuhe": "Altkleider/Schuhe",
"schadstoffe": "Schadstoffe"
},
"data_description": {
"calendar_title": "Ein lesbarerer oder benutzerfreundlicherer Name für den Müllkalender. Wenn nichts angegeben wird, wird der Name der Quelle verwendet."
Expand All @@ -4045,7 +4052,14 @@
"address_suffix": "Hausnummerzusatz",
"city": "Ort",
"house_number": "Hausnummer",
"street": "Straße"
"street": "Straße",
"restmuell": "Restmuell",
"bioenergietonne": "Bioenergietonne",
"altpapier_papiertonne": "Altpapier, Papiertonne",
"altpapier_buendelsammlung": "Altpapier, Buendelsammlung",
"verpackungstonne": "Verpackungstonne",
"altkleider_schuhe": "Altkleider/Schuhe",
"schadstoffe": "Schadstoffe"
},
"data_description": {}
},
Expand Down
18 changes: 16 additions & 2 deletions custom_components/waste_collection_schedule/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -4058,7 +4058,14 @@
"address_suffix": "Address Suffix",
"city": "City",
"house_number": "House Number",
"street": "Street"
"street": "Street",
"restmuell": "Residual Waste",
"bioenergietonne": "Bioenergy Bin",
"altpapier_papiertonne": "Waste Paper, Paper Bin",
"altpapier_buendelsammlung": "Waste Paper, Bundle Collection",
"verpackungstonne": "Packaging Bin",
"altkleider_schuhe": "Old Clothes/Shoes",
"schadstoffe": "Hazardous Waste"
},
"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."
Expand All @@ -4072,7 +4079,14 @@
"address_suffix": "Address Suffix",
"city": "City",
"house_number": "House Number",
"street": "Street"
"street": "Street",
"restmuell": "Residual Waste",
"bioenergietonne": "Bioenergy Bin",
"altpapier_papiertonne": "Waste Paper, Paper Bin",
"altpapier_buendelsammlung": "Waste Paper, Bundle Collection",
"verpackungstonne": "Packaging Bin",
"altkleider_schuhe": "Old Clothes/Shoes",
"schadstoffe": "Hazardous Waste"
},
"data_description": {}
},
Expand Down
18 changes: 16 additions & 2 deletions custom_components/waste_collection_schedule/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -4003,7 +4003,14 @@
"address_suffix": "Address Suffix",
"city": "City",
"house_number": "House Number",
"street": "Street"
"street": "Street",
"restmuell": "Déchets Résiduels",
"bioenergietonne": "Bac Bioénergie",
"altpapier_papiertonne": "Papier Usagé, Bac à Papier",
"altpapier_buendelsammlung": "Papier Usagé, Collecte en Paquets",
"verpackungstonne": "Bac d'Emballage",
"altkleider_schuhe": "Vêtements/Chaussures Usagés",
"schadstoffe": "Déchets Dangereux"
},
"data_description": {
"calendar_title": "Un nom plus lisible ou convivial pour le calendrier des déchets. Si aucun n'est fourni, le nom renvoyé par la source sera utilisé."
Expand All @@ -4017,7 +4024,14 @@
"address_suffix": "Address Suffix",
"city": "City",
"house_number": "House Number",
"street": "Street"
"street": "Street",
"restmuell": "Déchets Résiduels",
"bioenergietonne": "Bac Bioénergie",
"altpapier_papiertonne": "Papier Usagé, Bac à Papier",
"altpapier_buendelsammlung": "Papier Usagé, Collecte en Paquets",
"verpackungstonne": "Bac d'Emballage",
"altkleider_schuhe": "Vêtements/Chaussures Usagés",
"schadstoffe": "Déchets Dangereux"
},
"data_description": {}
},
Expand Down
18 changes: 16 additions & 2 deletions custom_components/waste_collection_schedule/translations/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -4010,7 +4010,14 @@
"address_suffix": "Address Suffix",
"city": "Città",
"house_number": "Civico",
"street": "Strada"
"street": "Strada",
"restmuell": "Rifiuti Residui",
"bioenergietonne": "Bidone Bioenergia",
"altpapier_papiertonne": "Carta da Macero, Bidone della Carta",
"altpapier_buendelsammlung": "Carta da Macero, Raccolta a Pacchi",
"verpackungstonne": "Bidone degli Imballaggi",
"altkleider_schuhe": "Vestiti/Scarpe Usati",
"schadstoffe": "Rifiuti Pericolosi"
},
"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."
Expand All @@ -4024,7 +4031,14 @@
"address_suffix": "Address Suffix",
"city": "Città",
"house_number": "Civico",
"street": "Strada"
"street": "Strada",
"restmuell": "Rifiuti Residui",
"bioenergietonne": "Bidone Bioenergia",
"altpapier_papiertonne": "Carta da Macero, Bidone della Carta",
"altpapier_buendelsammlung": "Carta da Macero, Raccolta a Pacchi",
"verpackungstonne": "Bidone degli Imballaggi",
"altkleider_schuhe": "Vestiti/Scarpe Usati",
"schadstoffe": "Rifiuti Pericolosi"
},
"data_description": {}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,33 @@ def handle_starttag(self, tag, attrs):

class Source:
def __init__(
self, city: str, street: str, house_number: int, address_suffix: str = ""
self,
city: str,
street: str,
house_number: int,
address_suffix: str = "",
restmuell: bool = True,
bioenergietonne: bool = True,
altpapier_papiertonne: bool = True,
altpapier_buendelsammlung: bool = True,
verpackungstonne: bool = True,
altkleider_schuhe: bool = True,
schadstoffe: bool = True,
):
self._city = city
self._street = street
self._hnr = house_number
self._suffix = address_suffix
self._ics = ICS()
self._container_selection = {
1: restmuell,
2: bioenergietonne,
3: altpapier_papiertonne,
4: altpapier_buendelsammlung,
5: verpackungstonne,
6: altkleider_schuhe,
7: schadstoffe,
}

def fetch(self):
session = requests.session()
Expand Down Expand Up @@ -104,16 +124,11 @@ def fetch(self):
r.raise_for_status()

args["SubmitAction"] = "forward"
args["ContainerGewaehlt_1"] = "on"
args["ContainerGewaehlt_2"] = "on"
args["ContainerGewaehlt_3"] = "on"
args["ContainerGewaehlt_4"] = "on"
args["ContainerGewaehlt_5"] = "on"
args["ContainerGewaehlt_6"] = "on"
args["ContainerGewaehlt_7"] = "on"
args["ContainerGewaehlt_8"] = "on"
args["ContainerGewaehlt_9"] = "on"
args["ContainerGewaehlt_10"] = "on"

for idx, selected in self._container_selection.items():
if selected:
args[f"ContainerGewaehlt_{idx}"] = "on"

r = session.post(
SERVLET,
data=args,
Expand Down

0 comments on commit fd4b212

Please sign in to comment.