diff --git a/README.md b/README.md index 2f033fff..a8fba5f4 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ Waste collection schedules in the following formats and countries are supported. - [The Hills Shire Council, Sydney](/doc/source/thehills_nsw_gov_au.md) / thehills.nsw.gov.au - [Unley City Council (SA)](/doc/source/unley_sa_gov_au.md) / unley.sa.gov.au - [Whittlesea City Council](/doc/source/whittlesea_vic_gov_au.md) / whittlesea.vic.gov.au/community-support/my-neighbourhood +- [Wollondilly Shire Council](/doc/source/wollondilly_nsw_gov_au.md) / wollondilly.nsw.gov.au - [Wollongong City Council](/doc/source/wollongongwaste_com_au.md) / wollongongwaste.com - [Wyndham City Council, Melbourne](/doc/source/wyndham_vic_gov_au.md) / wyndham.vic.gov.au - [Yarra Ranges Council](/doc/source/yarra_ranges_vic_gov_au.md) / yarraranges.vic.gov.au diff --git a/custom_components/waste_collection_schedule/waste_collection_schedule/source/wollondilly_nsw_gov_au.py b/custom_components/waste_collection_schedule/waste_collection_schedule/source/wollondilly_nsw_gov_au.py new file mode 100644 index 00000000..029eae37 --- /dev/null +++ b/custom_components/waste_collection_schedule/waste_collection_schedule/source/wollondilly_nsw_gov_au.py @@ -0,0 +1,60 @@ +from datetime import datetime + +import requests +from waste_collection_schedule import Collection # type: ignore[attr-defined] + +TITLE = "Wollondilly Shire Council" +DESCRIPTION = "Source for Wollondilly Shire Council." +URL = "https://www.wollondilly.nsw.gov.au/" +TEST_CASES = { + "87 Remembrance Driveway TAHMOOR NSW": { + "address": "87 Remembrance Driveway TAHMOOR NSW" + }, + "Thirlmere Way THIRLMERE NSW": {"address": "Thirlmere Way THIRLMERE NSW"}, +} + + +ICON_MAP = { + "garbage": "mdi:trash-can", + "garden organic": "mdi:leaf", + "recycling": "mdi:recycle", +} + + +ADDRESS_URL = "https://yokqi4ofx1.execute-api.ap-southeast-2.amazonaws.com/Live/wcc_address_lookup" +INFO_URL = "https://yokqi4ofx1.execute-api.ap-southeast-2.amazonaws.com/Live/wcc_details_lookup" + + +class Source: + def __init__(self, address: str): + self._address: str = address + + def fetch(self): + args = {"fields": self._address} + + r = requests.get(ADDRESS_URL, params=args) + r.raise_for_status() + + data = r.json() + if len(data) == 0: + raise Exception("Address not found") + + id = data[0][1]["value"] + args = {"fields": id} + r = requests.get(INFO_URL, params=args) + r.raise_for_status() + + data = r.json() + entries = [] + for collection in data[0]: + if "WasteNextPickup" not in collection["name"]: + continue + info_arr = collection["value"].split(", ") + date_str = info_arr[1] + collection_str = info_arr[2] + date = datetime.strptime(date_str, "%d %B %Y").date() + collection_types = collection_str.split(" and ") + for col_type in collection_types: + icon = ICON_MAP.get(col_type.lower()) + entries.append(Collection(date=date, t=col_type, icon=icon)) + return entries diff --git a/doc/source/wollondilly_nsw_gov_au.md b/doc/source/wollondilly_nsw_gov_au.md new file mode 100644 index 00000000..0eb62c45 --- /dev/null +++ b/doc/source/wollondilly_nsw_gov_au.md @@ -0,0 +1,34 @@ +# Wollondilly Shire Council + +Support for schedules provided by [Wollondilly Shire Council](https://www.wollondilly.nsw.gov.au/), serving Wollondilly Shire Council, Australia. + +## Configuration via configuration.yaml + +```yaml +waste_collection_schedule: + sources: + - name: wollondilly_nsw_gov_au + args: + address: ADDRESS + +``` + +### Configuration Variables + +**address** +*(String) (required)* + +## Example + +```yaml +waste_collection_schedule: + sources: + - name: wollondilly_nsw_gov_au + args: + address: 87 Remembrance Driveway TAHMOOR NSW + +``` + +## How to get the source argument + +Find the parameter of your address using [https://www.wollondilly.nsw.gov.au/waste-services/lookup-your-clean-up-details](https://www.wollondilly.nsw.gov.au/waste-services/lookup-your-clean-up-details) and write them exactly like on the web page. diff --git a/info.md b/info.md index 3de979c5..4671df1e 100644 --- a/info.md +++ b/info.md @@ -16,7 +16,7 @@ Waste collection schedules from service provider web sites are updated daily, de |--|--| | Generic | ICS / iCal files | | Static | User-defined dates or repeating date patterns | -| Australia | Armadale (Western Australia), Australian Capital Territory (ACT), Banyule City Council, Belmont City Council, Blacktown City Council (NSW), Brisbane City Council, Campbelltown City Council (NSW), Cardinia Shire Council, City of Ballarat, City of Canada Bay Council, City of Greater Geelong, City of Kingston, City of Onkaparinga Council, Cumberland Council (NSW), Gold Coast City Council, Hobsons Bay City Council, Hume City Council, Inner West Council (NSW), Ipswich City Council, Ku-ring-gai Council, Lake Macquarie City Council, Logan City Council, Macedon Ranges Shire Council, Mansfield Shire Council, Maribyrnong Council, Maroondah City Council, Melton City Council, Merri-bek City Council, Moreton Bay, Nillumbik Shire Council, North Adelaide Waste Management Authority, Port Adelaide Enfield, South Australia, RecycleSmart, Redland City Council (QLD), Shellharbour City Council, Stonnington City Council, The Hills Shire Council, Sydney, Unley City Council (SA), Whittlesea City Council, Wollongong City Council, Wyndham City Council, Melbourne, Yarra Ranges Council | +| Australia | Armadale (Western Australia), Australian Capital Territory (ACT), Banyule City Council, Belmont City Council, Blacktown City Council (NSW), Brisbane City Council, Campbelltown City Council (NSW), Cardinia Shire Council, City of Ballarat, City of Canada Bay Council, City of Greater Geelong, City of Kingston, City of Onkaparinga Council, Cumberland Council (NSW), Gold Coast City Council, Hobsons Bay City Council, Hume City Council, Inner West Council (NSW), Ipswich City Council, Ku-ring-gai Council, Lake Macquarie City Council, Logan City Council, Macedon Ranges Shire Council, Mansfield Shire Council, Maribyrnong Council, Maroondah City Council, Melton City Council, Merri-bek City Council, Moreton Bay, Nillumbik Shire Council, North Adelaide Waste Management Authority, Port Adelaide Enfield, South Australia, RecycleSmart, Redland City Council (QLD), Shellharbour City Council, Stonnington City Council, The Hills Shire Council, Sydney, Unley City Council (SA), Whittlesea City Council, Wollondilly Shire Council, Wollongong City Council, Wyndham City Council, Melbourne, Yarra Ranges Council | | Austria | Abfallverband Hollabrunn, Abfallverband Korneuburg, Abfallverband Schwechat, Abfallwirtschaft Stadt Krems, Abfallwirtschaft Stadt St Pölten, Afritz am See, Alpbach, Altenmarkt an der Triesting, Althofen, Andau, Angath, Apetlon, App CITIES, Arnoldstein, Aschau im Zillertal, AWV Neunkirchen, AWV Wr. Neustadt, Bad Blumau, Bad Gleichenberg, Bad Häring, Bad Kleinkirchheim, Bad Loipersdorf, Bad Radkersburg, Bad Tatzmannsdorf, Bad Waltersdorf, Baldramsdorf, Berg im Drautal, Berndorf bei Salzburg, Bernstein, Bildein, Brandenberg, Breitenbach am Inn, Breitenbrunn am Neusiedler See, Breitenstein, Bromberg, Bruckneudorf, Buch - St. Magdalena, Burgau, Burgauberg-Neudauberg, Burgenländischer Müllverband, Dechantskirchen, Dellach, Dellach im Drautal, Deutsch Goritz, Deutsch Jahrndorf, Deutsch Kaltenbrunn, Deutschkreutz, Die NÖ Umweltverbände, Dobl-Zwaring, Drasenhofen, Draßmarkt, Ebenthal in Kärnten, Eberau, Eberndorf, Ebersdorf, Eberstein, Edelsbach bei Feldbach, Eggenburg, Eggersdorf bei Graz, Eichgraben, Eisenstadt, Eugendorf, Fehring, Feistritz im Rosental, Feistritz ob Bleiburg, Feldbach, Feldkirchen in Kärnten, Feldkirchen in Kärnten, Ferlach, Ferndorf, Ferndorf, Finkenstein am Faaker See, Frankenau-Unterpullendorf, Frauenkirchen, Frauenstein, Freistadt, Fresach, Friedberg, Frohnleiten, Fürstenfeld, Gabersdorf, GABL, Gattendorf, GAUL Laa an der Thaya, GAUM Mistelbach, GDA Amstetten, Gemeindeverband Horn, Gitschtal, Gitschtal, Globasnitz, Gmünd in Kärnten, Gols, Grafendorf bei Hartberg, Grafenschachen, Grafenstein, Grafenstein, Gratkorn, Gratwein-Straßengel, Greifenburg, Großkirchheim, Großsteinbach, Großwarasdorf, Großwilfersdorf, Gutenberg, Guttaring, GV Gmünd, GV Krems, GV Zwettl, GVA Baden, GVA Baden, GVA Lilienfeld, GVA Mödling, GVA Tulln, GVA Waidhofen/Thaya, GVU Bezirk Gänserndorf, GVU Melk, GVU Scheibbs, GVU Scheibbs, GVU St. Pölten, Güssing, Hagenberg im Mühlkreis, Hannersdorf, Hartberg, Heiligenblut am Großglockner, Heiligenkreuz, Heiligenkreuz am Waasen, Heimschuh, Henndorf am Wallersee, Henndorf am Wallersee, Hermagor-Pressegger See, Hirm, Hofstätten an der Raab, Hopfgarten im Brixental, Horitschon, Horn, Hornstein, Hüttenberg, Ilz, infeo, Innsbrucker Kommunalbetriebe, Inzenhof, Irschen, Jabing, Jagerberg, Kaindorf, Kaisersdorf, Kalsdorf bei Graz, Kapfenstein, Kemeten, Keutschach am See, Kirchbach, Kirchbach-Zerlach, Kirchberg an der Raab, Kirchbichl, Kirchdorf in Tirol, Kittsee, Klagenfurt am Wörthersee, Kleblach-Lind, Kleinmürbisch, Klingenbach, Klosterneuburg, Klöch, Kobersdorf, Kohfidisch, Korneuburg, Krems in Kärnten, Krensdorf, Krumpendorf am Wörthersee, Kuchl, Kundl, Kössen, Köstendorf, Kötschach-Mauthen, Köttmannsdorf, Laa an der Thaya, Lackenbach, Lackendorf, Langau, Langenrohr, Leithaprodersdorf, Lendorf, Leoben, Lesachtal, Leutschach an der Weinstraße, Lieboch, Linz AG, Litzelsdorf, Lockenhaus, Loipersbach im Burgenland, Ludmannsdorf, Lurnfeld, Magdalensberg, Mallnitz, Malta, Maria Rain, Maria Saal, Maria Wörth, Mariasdorf, Markt Hartmannsdorf, Markt Neuhodis, Marktgemeinde Edlitz, Marz, Mattersburg, Mattsee, Meiseldorf, Melk, Mettersdorf am Saßbach, Miesenbach, Millstatt, Mischendorf, Mistelbach, Mitterdorf an der Raab, Moosburg, Mureck, Mönchhof, Mörbisch am See, Mörtschach, Mühldorf, Müll App, Münster, Neudorf bei Parndorf, Neudörfl, Neufeld an der Leitha, Neumarkt am Wallersee, Neusiedl am See, Neustift bei Güssing, Nickelsdorf, Oberdrauburg, Oberndorf in Tirol, Oberpullendorf, Oberschützen, Obertrum am See, Oberwart, Oslip, Ottendorf an der Rittschein, Ottobrunn, Paldau, Pama, Pamhagen, Parndorf, Paternion, Payerbach, Peggau, Pernegg an der Mur, Pernegg im Waldviertel, Pfarrwerfen, Pilgersdorf, Pinggau, Pinkafeld, Podersdorf am See, Poggersdorf, Poggersdorf, Potzneusiedl, Poysdorf, Pöchlarn, Pörtschach am Wörther See, Raach am Hochgebirge, Raasdorf, Radenthein, Radfeld, Radmer, Ragnitz, Raiding, Ramsau im Zillertal, Rangersdorf, Reichenau, Reichenfels, Reith im Alpbachtal, Reißeck, Rennweg am Katschberg, Rohr bei Hartberg, Rohr im Burgenland, Rudersdorf, Rust, Saalfelden am Steinernen Meer, Sachsenburg, Sankt Georgen an der Stiefing, Sankt Gilgen, Sankt Oswald bei Plankenwarth, Schiefling am Wörthersee, Schleedorf, Schrattenberg, Schwadorf, Schwaz, Schwoich, Schäffern, Schützen am Gebirge, Seeboden, Seeham, Seekirchen am Wallersee, Seiersberg-Pirka, Siegendorf, Sigleß, Sigmundsherberg, Sinabelkirchen, Spittal an der Drau, St. Andrä, St. Andrä, St. Andrä am Zicksee, St. Anna am Aigen, St. Egyden am Steinfeld, St. Georgen an der Leys, St. Jakob im Rosental, St. Jakob im Rosental, St. Johann in der Haide, St. Johann in Tirol, St. Konrad, St. Lorenzen am Wechsel, St. Margareten im Rosental, St. Margarethen an der Raab, St. Margarethen im Burgenland, St. Peter - Freienstein, St. Peter am Ottersbach, St. Ruprecht an der Raab, St. Symvaro, St. Veit in der Südsteiermark, Stadt Salzburg, Stadtgemeinde Traiskirchen, Stadtservice Korneuburg, Stall, Stegersbach, Steinbrunn, Steinfeld, Steuerberg, Stinatz, Stiwoll, Stockenboi, Stockerau, Strass im Zillertal, Straß in Steiermark, Straßwalchen, Söchau, Söll, Tadten, Tattendorf, Techelsberg am Wörther See, Thal, Tieschen, Tobaj, Trebesing, Treffen am Ossiacher See, Tulln an der Donau, Umweltprofis, Unterfrauenhaid, Unterkohlstätten, Unterlamm, Unterwart, Vasoldsberg, Velden am Wörther See, Villach, Vordernberg, Völkermarkt, Völkermarkt, Walpersbach, Wattens, Weiden am See, Weitersfeld, Weiz, Weißensee, Weppersdorf, Werfenweng, Wies, Wiesen, Wiesfleck, Wiesmath, Wimpassing an der Leitha, Winden am See, Winklern, Wolfau, Wolfsberg, Wolfsberg, Wolkersdorf im Weinviertel, WSZ Moosburg, Wulkaprodersdorf, Wörterberg, Zagersdorf, Zelking-Matzleinsdorf, Zell, Zell am Ziller, Zellberg, Zillingtal, Zurndorf, Übelbach | | Belgium | Hygea, Limburg.net, Recycle! | | Canada | Aurora (ON), Calgary (AB), Calgary, AB, City of Edmonton, AB, City of Greater Sudbury, ON, City of Nanaimo, City of Peterborough, ON, City of Vancouver, London (ON), Montreal (QC), Ottawa, Canada, RM of Morris, MB, Strathcona County, ON, Toronto (ON), Vaughan (ON), Waste Wise APPS, Winnipeg (MB) |