Skip to content

Commit 7d6ef7e

Browse files
bratanon5ila5
andauthored
Add Mölndal source (mampfes#2332)
* Add Mölndal source * reformatting --------- Co-authored-by: 5ila5 <[email protected]>
1 parent 8f2ecdf commit 7d6ef7e

File tree

6 files changed

+84
-3
lines changed

6 files changed

+84
-3
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -1212,6 +1212,7 @@ Waste collection schedules in the following formats and countries are supported.
12121212
- [Lerum Vatten och Avlopp](/doc/source/lerum_se.md) / vatjanst.lerum.se
12131213
- [Linköping - Tekniska Verken](/doc/source/tekniskaverken_se.md) / tekniskaverken.se
12141214
- [Lund Waste Collection](/doc/source/lund_se.md) / eservice431601.lund.se
1215+
- [Mölndal](/doc/source/molndal_se.md) / molndal.se
12151216
- [Norrtalje Vatten & Avfall](/doc/source/nvaa_se.md) / sjalvservice.nvaa.se
12161217
- [North / Middle Bohuslän - Rambo AB](/doc/source/rambo_se.md) / rambo.se
12171218
- [Region Gotland](/doc/source/gotland_se.md) / gotland.se

custom_components/waste_collection_schedule/sources.json

+5
Original file line numberDiff line numberDiff line change
@@ -6425,6 +6425,11 @@
64256425
"module": "lund_se",
64266426
"default_params": {}
64276427
},
6428+
{
6429+
"title": "M\u00f6lndal",
6430+
"module": "molndal_se",
6431+
"default_params": {}
6432+
},
64286433
{
64296434
"title": "Norrtalje Vatten & Avfall",
64306435
"module": "nvaa_se",

custom_components/waste_collection_schedule/translations/en.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,8 @@
275275
"zipCode": "Zip Code",
276276
"garden_cutomer": "Garden Cutomer",
277277
"app": "App",
278-
"service_provider": "Service Provider"
278+
"service_provider": "Service Provider",
279+
"facility_id": "Facility Id"
279280
},
280281
"data_description": {
281282
"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."
@@ -522,7 +523,8 @@
522523
"zipCode": "Zip Code",
523524
"garden_cutomer": "Garden Cutomer",
524525
"app": "App",
525-
"service_provider": "Service Provider"
526+
"service_provider": "Service Provider",
527+
"facility_id": "Facility Id"
526528
}
527529
}
528530
},
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
from datetime import datetime
2+
3+
import requests
4+
from waste_collection_schedule import Collection # type: ignore[attr-defined]
5+
6+
TITLE = "Mölndal"
7+
DESCRIPTION = "Source for Mölndal waste collection."
8+
URL = "https://molndal.se"
9+
TEST_CASES = {"105000": {"facility_id": "105000"}, "109400": {"facility_id": 109400}}
10+
11+
API_URL = "https://future.molndal.se/FutureWeb/SimpleWastePickup"
12+
13+
14+
class Source:
15+
def __init__(self, facility_id: int | str):
16+
self.facility_id: str = str(facility_id)
17+
18+
def fetch(self):
19+
url = f"{API_URL}/GetWastePickupSchedule"
20+
params = {"address": f"({self.facility_id})"}
21+
response = requests.get(url, params=params, timeout=30)
22+
response.raise_for_status()
23+
24+
data = response.json()
25+
26+
entries = []
27+
for item in data["RhServices"]:
28+
next_pickup = item["NextWastePickup"]
29+
if not next_pickup:
30+
continue
31+
32+
next_pickup_date = datetime.strptime(next_pickup, "%Y-%m-%d").date()
33+
waste_type = item["WasteType"]
34+
35+
entries.append(
36+
Collection(date=next_pickup_date, t=waste_type, icon="mdi:trash-can")
37+
)
38+
39+
return entries

doc/source/molndal_se.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Mölndal
2+
3+
This is a waste collection schedule integration for the Mölndal.
4+
Mölndal is using EDPEvent but does not allow for address search.
5+
6+
## Configuration via configuration.yaml
7+
8+
```yaml
9+
waste_collection_schedule:
10+
sources:
11+
- name: molndal_se
12+
args:
13+
facility_id: FACILITY_ID
14+
```
15+
16+
### Configuration Variables
17+
18+
**facility_id**
19+
*(number) (required)*
20+
21+
## Examples
22+
23+
```yaml
24+
waste_collection_schedule:
25+
sources:
26+
- name: molndal_se
27+
args:
28+
facility_id: 105000
29+
```
30+
31+
## How to get the correct facility id
32+
33+
Your facility_id (Anläggning) can be found on invoices from Mölndals stad or
34+
by the [Mölndals stad e-tjänst](https://etjanst.molndal.se/oversikt/overview/720).

info.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Waste collection schedules from service provider web sites are updated daily, de
3434
| Norway | BIR (Bergensområdets Interkommunale Renovasjonsselskap), IRiS, Min Renovasjon, Movar IKS, Oslo Kommune, ReMidt Orkland muni, Sandnes Kommune, Stavanger Kommune, Trondheim |
3535
| Poland | Bydgoszcz Pronatura, Ecoharmonogram, Gmina Miękinia, Koziegłowy/Objezierze/Oborniki, Poznań, Warsaw, Wrocław |
3636
| Slovenia | Moji odpadki, Ljubljana |
37-
| Sweden | Affärsverken, Boden, EDPEvent - Multi Source, Gästrike Återvinnare, Jönköping - June Avfall & Miljö, Landskrona - Svalövs Renhållning, Lerum Vatten och Avlopp, Linköping - Tekniska Verken, Lund Waste Collection, Norrtalje Vatten & Avfall, North / Middle Bohuslän - Rambo AB, Region Gotland, Ronneby Miljöteknik, Samverkan Återvinning Miljö (SÅM), Skellefteå, SRV Återvinning, SSAM (Deprecated), SSAM Södra Smalånds Avfall & Miljö, Sysav Sophämntning, Uppsala Vatten, Uppsala Vatten och Avfall AB (Deprecated), VA Syd Sophämntning, VIVAB Sophämtning |
37+
| Sweden | Affärsverken, Boden, EDPEvent - Multi Source, Gästrike Återvinnare, Jönköping - June Avfall & Miljö, Landskrona - Svalövs Renhållning, Lerum Vatten och Avlopp, Linköping - Tekniska Verken, Lund Waste Collection, Mölndal, Norrtalje Vatten & Avfall, North / Middle Bohuslän - Rambo AB, Region Gotland, Ronneby Miljöteknik, Samverkan Återvinning Miljö (SÅM), Skellefteå, SRV Återvinning, SSAM (Deprecated), SSAM Södra Smalånds Avfall & Miljö, Sysav Sophämntning, Uppsala Vatten, Uppsala Vatten och Avfall AB (Deprecated), VA Syd Sophämntning, VIVAB Sophämtning |
3838
| Switzerland | A-Region, Alchenstorf, Andwil, Appenzell, Berg, Bühler, Canton of Zürich, Eggersriet, Gais, Gaiserwald, Goldach, Grosswangen, Grub, Heiden, Herisau, Horn, Hundwil, Häggenschwil, Lindau, Lutzenberg, Muolen, Mörschwil, Münchenstein, Münsingen BE, Switzerland, Real Luzern, Rehetobel, Rorschach, Rorschacherberg, Schwellbrunn, Schönengrund, Speicher, Stein, Steinach, Teufen, Thal, Trogen, Tübach, Untereggen, Urnäsch, Wald, Waldkirch, Waldstatt, Wittenbach, Wolfhalden |
3939
| United Kingdom | Aberdeenshire Council, Adur & Worthing Councils, Allerdale Borough Council, Amber Valley Borough Council, Anglesey, Apps by imactivate, Ards and North Down Borough Council, Ashfield District Council, Ashford Borough Council, Aylesbury Vale District Council, Barnsley Metropolitan Borough Council, Basildon Council, Basingstoke and Deane Borough Council, Bath & North East Somerset Council, BCP Council, Bedford Borough Council, Binzone, Birmingham City Council, Blackburn with Darwen Borough Council, Blackpool Council, Borough Council of King's Lynn & West Norfolk, Borough of Broxbourne Council, Bracknell Forest Council, Bradford Metropolitan District Council, Braintree District Council, Breckland Council, Brent Council, Bristol City Council, Broadland District Council, Bromsgrove City Council, Broxtowe Borough Council, Buckinghamshire Waste Collection - Former Chiltern, South Bucks or Wycombe areas, Burnley Council, Bury Council, Cambridge City Council, Canterbury City Council, Cardiff Council, Central Bedfordshire Council, Cherwell District Council, Cheshire East Council, Cheshire West and Chester Council, Chesterfield Borough Council, Chichester District Council, City of Doncaster Council, City Of Lincoln Council, City of York Council, Colchester City Council, Conwy County Borough Council, Cornwall Council, Crawley Borough Council (myCrawley), Croydon Council, Darlington Borough Council, Denbighshire County Council, Derby City Council, Dudley Metropolitan Borough Council, Durham County Council, East Ayrshire Council, East Cambridgeshire District Council, East Devon District Council, East Herts Council, East Lothian, East Northamptonshire and Wellingborough, East Renfrewshire Council, East Riding of Yorkshire Council, Eastbourne Borough Council, Eastleigh Borough Council, Elmbridge Borough Council, Environment First, Exeter City Council, Falkirk, Fareham Borough Council, FCC Environment, Fenland, Fenland District Council, Fife Council, Flintshire, Fylde Council, Gateshead Council, Gedling Borough Council (unofficial), Glasgow City Council, Guildford Borough Council, Gwynedd, Harborough District Council, Haringey Council, Harlow Council, Hart District Council, Herefordshire City Council, Highland, Horsham District Council, Hull City Council, Huntingdonshire District Council, iTouchVision, Joint Waste Solutions, Kirklees Council, Lancaster City Council, Leeds, Leicester City Council, Lewes District Council, Lichfield District Council, Lisburn and Castlereagh City Council, Liverpool City Council, London Borough of Barking and Dagenham, London Borough of Bexley, London Borough of Bromley, London Borough of Camden, London Borough of Harrow, London Borough of Hounslow, London Borough of Lewisham, London Borough of Merton, London Borough of Newham, Luton, Maidstone Borough Council, Maldon District Council, Manchester City Council, Mansfield District Council, Mendip District Council, Mid-Sussex District Council, Middlesbrough Council, Milton Keynes council, Moray Council, Newark & Sherwood District Council, Newcastle City Council, Newcastle Under Lyme Borough Council, Newport City Council, North Ayrshire Council, North Herts Council, North Kesteven District Council, North Lincolnshire Council, North Northamptonshire council, North Somerset Council, North West Leicestershire District Council, North Yorkshire Council - Hambleton, North Yorkshire Council - Harrogate, North Yorkshire Council - Scarborough, North Yorkshire Council - Selby, Nottingham City Council, Oxford City Council, Peterborough City Council, Portsmouth City Council, Reading Council, Redbridge Council, Reigate & Banstead Borough Council, Renfrewshire Council, Rhondda Cynon Taf County Borough Council, Richmondshire District Council, Rotherham, Rotherham Metropolitan Borough Council, Runnymede Borough Council, Rushcliffe Brough Council, Rushmoor Borough Council, Salford City Council, Sedgemoor District Council, Sheffield City Council, Shropshire Council, Solihull Council, Somerset Council, Somerset County Council, Somerset West & Taunton District Council, South Cambridgeshire District Council, South Derbyshire District Council, South Gloucestershire Council, South Hams District Council, South Holland District Council, South Kesteven District Council, South Norfolk Council, South Oxfordshire District Council, South Somerset District Council, South Tyneside Council, Southampton City Council, St Albans City & District Council, Stafford Borough Council, Stevenage Borough Council, Stirling.gov.uk, Stockport Council, Stockton-on-Tees Borough Council, Stoke-on-Trent, Stratford District Council, Stroud District Council, Surrey Heath Borough Council, Sutton Council, London, Swansea Council, Swindon Borough Council, Tameside Metropolitan Borough Council, Telford and Wrekin Council, Test Valley Borough Council, Tewkesbury Borough Council, The Royal Borough of Kingston Council, Tonbridge and Malling Borough Council, Tunbridge Wells, UK Bin Collection Schedule (UKBCD) project, Uttlesford District Council, Vale of Glamorgan Council, Vale of White Horse District Council, Walsall Council, Warrington Borough Council, Warwick District Council, Waverley Borough Council, Wealden District Council, Welwyn Hatfield Borough Council, West Berkshire Council, West Devon Borough Council, West Dunbartonshire Council, West Northamptonshire council, West Suffolk Council, Westmorland & Furness Council, Barrow area, Westmorland & Furness Council, South Lakeland area, Wigan Council, Wiltshire Council, Windsor and Maidenhead, Wirral Council, Woking Borough Council, Wokingham Borough Council, Wychavon District Council, Wyre Forest District Council |
4040
| United States of America | Albuquerque, New Mexico, USA, City of Austin, TX, City of Bloomington, City of Cambridge, City of Gastonia, NC, City of Georgetown, TX, City of Oklahoma City, City of Pittsburgh, Louisville, Kentucky, USA, Newark, Delaware, USA, Olympia, Washington, USA, ReCollect, Recycle Coach, Republic Services, Seattle Public Utilities, Tucson, Arizona, USA |

0 commit comments

Comments
 (0)