Skip to content

Commit 6a39c0c

Browse files
committed
adding North East Lincolnshire Council, uk
1 parent 4e7f5a2 commit 6a39c0c

File tree

9 files changed

+197
-1
lines changed

9 files changed

+197
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2407,6 +2407,7 @@ If your service provider is not listed, feel free to open a [source request issu
24072407
- [Newport City Council](/doc/source/iapp_itouchvision_com.md) / newport.gov.uk
24082408
- [Newport City Council](/doc/source/iweb_itouchvision_com.md) / newport.gov.uk/
24092409
- [North Ayrshire Council](/doc/source/north_ayrshire_gov_uk.md) / north-ayrshire.gov.uk
2410+
- [North East Lincolnshire Council](/doc/source/nelincs_gov_uk.md) / nelincs.gov.uk
24102411
- [North Herts Council](/doc/source/northherts_gov_uk.md) / north-herts.gov.uk
24112412
- [North Kesteven District Council](/doc/source/north_kesteven_org_uk.md) / n-kesteven.org.uk
24122413
- [North Lanarkshire Council](/doc/source/northlanarkshire_gov_uk.md) / northlanarkshire.gov.uk

custom_components/waste_collection_schedule/sources.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15425,6 +15425,12 @@
1542515425
"default_params": {},
1542615426
"id": "north_ayrshire_gov_uk"
1542715427
},
15428+
{
15429+
"title": "North East Lincolnshire Council",
15430+
"module": "nelincs_gov_uk",
15431+
"default_params": {},
15432+
"id": "nelincs_gov_uk"
15433+
},
1542815434
{
1542915435
"title": "North Herts Council",
1543015436
"module": "northherts_gov_uk",

custom_components/waste_collection_schedule/translations/de.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16530,6 +16530,29 @@
1653016530
"uprn": "Eine einfache Möglichkeit, Ihre Unique Property Reference Number (UPRN) zu finden, besteht darin, auf https://www.findmyaddress.co.uk/ zu gehen und Ihre Adressdaten einzugeben."
1653116531
}
1653216532
},
16533+
"args_nelincs_gov_uk": {
16534+
"title": "Quelle konfigurieren",
16535+
"description": "Konfiguriere deinen Service Provider. \n\nFill in your address details at [North East Lincolnshire Council's Find My Address](https://www.nelincs.gov.uk/find-my-address/), the Unique Property Reference Number (UPRN) will be shown in the URL field when you see your collection schedule. (e.g. `https://www.nelincs.gov.uk/?s=DN40+1JU&uprn=11043243` where `11043243` is the UPRN).\n\nAnother easy way to discover your Unique Property Reference Number (UPRN) is by going to https://www.findmyaddress.co.uk/ and entering in your address details.\n\n\nMehr details: https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/nelincs_gov_uk.md",
16536+
"data": {
16537+
"calendar_title": "Kalender Titel",
16538+
"uprn": "UPRN"
16539+
},
16540+
"data_description": {
16541+
"calendar_title": "Ein lesbarerer oder benutzerfreundlicherer Name für den Müllkalender. Wenn nichts angegeben wird, wird der Name der Quelle verwendet.",
16542+
"uprn": "Eine einfache Möglichkeit, Ihre Unique Property Reference Number (UPRN) zu finden, besteht darin, auf https://www.findmyaddress.co.uk/ zu gehen und Ihre Adressdaten einzugeben."
16543+
}
16544+
},
16545+
"reconfigure_nelincs_gov_uk": {
16546+
"title": "Quelle Neu Konfigurieren",
16547+
"description": "Konfiguriere deinen Service Provider. \n\nFill in your address details at [North East Lincolnshire Council's Find My Address](https://www.nelincs.gov.uk/find-my-address/), the Unique Property Reference Number (UPRN) will be shown in the URL field when you see your collection schedule. (e.g. `https://www.nelincs.gov.uk/?s=DN40+1JU&uprn=11043243` where `11043243` is the UPRN).\n\nAnother easy way to discover your Unique Property Reference Number (UPRN) is by going to https://www.findmyaddress.co.uk/ and entering in your address details.\n\n\nMehr details: https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/nelincs_gov_uk.md",
16548+
"data": {
16549+
"calendar_title": "Kalender Titel",
16550+
"uprn": "UPRN"
16551+
},
16552+
"data_description": {
16553+
"uprn": "Eine einfache Möglichkeit, Ihre Unique Property Reference Number (UPRN) zu finden, besteht darin, auf https://www.findmyaddress.co.uk/ zu gehen und Ihre Adressdaten einzugeben."
16554+
}
16555+
},
1653316556
"args_northherts_gov_uk": {
1653416557
"title": "Quelle konfigurieren",
1653516558
"description": "Konfiguriere deinen Service Provider. Mehr details: https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/northherts_gov_uk.md",

custom_components/waste_collection_schedule/translations/en.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16631,6 +16631,29 @@
1663116631
"uprn": "An easy way to discover your Unique Property Reference Number (UPRN) is by going to https://www.findmyaddress.co.uk/ and entering in your address details."
1663216632
}
1663316633
},
16634+
"args_nelincs_gov_uk": {
16635+
"title": "Configure Source",
16636+
"description": "Configure your service provider. \n\nFill in your address details at [North East Lincolnshire Council's Find My Address](https://www.nelincs.gov.uk/find-my-address/), the Unique Property Reference Number (UPRN) will be shown in the URL field when you see your collection schedule. (e.g. `https://www.nelincs.gov.uk/?s=DN40+1JU&uprn=11043243` where `11043243` is the UPRN).\n\nAnother easy way to discover your Unique Property Reference Number (UPRN) is by going to https://www.findmyaddress.co.uk/ and entering in your address details.\n\n\nMore details: https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/nelincs_gov_uk.md.",
16637+
"data": {
16638+
"calendar_title": "Calendar Title",
16639+
"uprn": "UPRN"
16640+
},
16641+
"data_description": {
16642+
"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.",
16643+
"uprn": "An easy way to discover your Unique Property Reference Number (UPRN) is by going to https://www.findmyaddress.co.uk/ and entering in your address details."
16644+
}
16645+
},
16646+
"reconfigure_nelincs_gov_uk": {
16647+
"title": "Reconfigure Source",
16648+
"description": "Configure your service provider. \n\nFill in your address details at [North East Lincolnshire Council's Find My Address](https://www.nelincs.gov.uk/find-my-address/), the Unique Property Reference Number (UPRN) will be shown in the URL field when you see your collection schedule. (e.g. `https://www.nelincs.gov.uk/?s=DN40+1JU&uprn=11043243` where `11043243` is the UPRN).\n\nAnother easy way to discover your Unique Property Reference Number (UPRN) is by going to https://www.findmyaddress.co.uk/ and entering in your address details.\n\n\nMore details: https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/nelincs_gov_uk.md.",
16649+
"data": {
16650+
"calendar_title": "Calendar Title",
16651+
"uprn": "UPRN"
16652+
},
16653+
"data_description": {
16654+
"uprn": "An easy way to discover your Unique Property Reference Number (UPRN) is by going to https://www.findmyaddress.co.uk/ and entering in your address details."
16655+
}
16656+
},
1663416657
"args_northherts_gov_uk": {
1663516658
"title": "Configure Source",
1663616659
"description": "Configure your service provider. More details: https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/northherts_gov_uk.md.",

custom_components/waste_collection_schedule/translations/fr.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16481,6 +16481,29 @@
1648116481
"uprn": "Une manière simple de retrouver votre numéro unique de propriété (UPRN) est de vous rendre sur https://www.findmyaddress.co.uk/ et de saisir les détails de votre adresse."
1648216482
}
1648316483
},
16484+
"args_nelincs_gov_uk": {
16485+
"title": "Configurer la Source",
16486+
"description": "Configurez votre fournisseur de services. \n\nFill in your address details at [North East Lincolnshire Council's Find My Address](https://www.nelincs.gov.uk/find-my-address/), the Unique Property Reference Number (UPRN) will be shown in the URL field when you see your collection schedule. (e.g. `https://www.nelincs.gov.uk/?s=DN40+1JU&uprn=11043243` where `11043243` is the UPRN).\n\nAnother easy way to discover your Unique Property Reference Number (UPRN) is by going to https://www.findmyaddress.co.uk/ and entering in your address details.\n\n\nPlus de détails : https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/nelincs_gov_uk.md.",
16487+
"data": {
16488+
"calendar_title": "Titre du Calendrier",
16489+
"uprn": "UPRN"
16490+
},
16491+
"data_description": {
16492+
"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é.",
16493+
"uprn": "Une manière simple de retrouver votre numéro unique de propriété (UPRN) est de vous rendre sur https://www.findmyaddress.co.uk/ et de saisir les détails de votre adresse."
16494+
}
16495+
},
16496+
"reconfigure_nelincs_gov_uk": {
16497+
"title": "Reconfigurer la Source",
16498+
"description": "Configurez votre fournisseur de services. \n\nFill in your address details at [North East Lincolnshire Council's Find My Address](https://www.nelincs.gov.uk/find-my-address/), the Unique Property Reference Number (UPRN) will be shown in the URL field when you see your collection schedule. (e.g. `https://www.nelincs.gov.uk/?s=DN40+1JU&uprn=11043243` where `11043243` is the UPRN).\n\nAnother easy way to discover your Unique Property Reference Number (UPRN) is by going to https://www.findmyaddress.co.uk/ and entering in your address details.\n\n\nPlus de détails : https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/nelincs_gov_uk.md.",
16499+
"data": {
16500+
"calendar_title": "Titre du Calendrier",
16501+
"uprn": "UPRN"
16502+
},
16503+
"data_description": {
16504+
"uprn": "Une manière simple de retrouver votre numéro unique de propriété (UPRN) est de vous rendre sur https://www.findmyaddress.co.uk/ et de saisir les détails de votre adresse."
16505+
}
16506+
},
1648416507
"args_northherts_gov_uk": {
1648516508
"title": "Configurer la Source",
1648616509
"description": "Configurez votre fournisseur de services. Plus de détails : https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/northherts_gov_uk.md.",

custom_components/waste_collection_schedule/translations/it.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16488,6 +16488,29 @@
1648816488
"uprn": "Un modo facile per scoprire il tuo Numero di Riferimento Proprietà Unica (UPRN) è andare su https://www.findmyaddress.co.uk/ e inserire i dettagli del tuo indirizzo."
1648916489
}
1649016490
},
16491+
"args_nelincs_gov_uk": {
16492+
"title": "Configurazione Sorgente",
16493+
"description": "Compila i campi per ottenere le informazioni sul tuo servizio di raccolta. \n\nFill in your address details at [North East Lincolnshire Council's Find My Address](https://www.nelincs.gov.uk/find-my-address/), the Unique Property Reference Number (UPRN) will be shown in the URL field when you see your collection schedule. (e.g. `https://www.nelincs.gov.uk/?s=DN40+1JU&uprn=11043243` where `11043243` is the UPRN).\n\nAnother easy way to discover your Unique Property Reference Number (UPRN) is by going to https://www.findmyaddress.co.uk/ and entering in your address details.\n\n\nMaggiori informazioni: https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/nelincs_gov_uk.md.",
16494+
"data": {
16495+
"calendar_title": "Nome Calendario",
16496+
"uprn": "UPRN"
16497+
},
16498+
"data_description": {
16499+
"calendar_title": "Puoi cambiare il nome del calendario della raccolta dei rifiuti, altrimenti di default verra' utilizzato il nome del tuo fornitore di servizi.",
16500+
"uprn": "Un modo facile per scoprire il tuo Numero di Riferimento Proprietà Unica (UPRN) è andare su https://www.findmyaddress.co.uk/ e inserire i dettagli del tuo indirizzo."
16501+
}
16502+
},
16503+
"reconfigure_nelincs_gov_uk": {
16504+
"title": "Riconfigurazione Sorgente",
16505+
"description": "Compila i campi per ottenere le informazioni sul tuo servizio di raccolta. \n\nFill in your address details at [North East Lincolnshire Council's Find My Address](https://www.nelincs.gov.uk/find-my-address/), the Unique Property Reference Number (UPRN) will be shown in the URL field when you see your collection schedule. (e.g. `https://www.nelincs.gov.uk/?s=DN40+1JU&uprn=11043243` where `11043243` is the UPRN).\n\nAnother easy way to discover your Unique Property Reference Number (UPRN) is by going to https://www.findmyaddress.co.uk/ and entering in your address details.\n\n\nPer maggiori informazioni: https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/nelincs_gov_uk.md.",
16506+
"data": {
16507+
"calendar_title": "Nome Calendario",
16508+
"uprn": "UPRN"
16509+
},
16510+
"data_description": {
16511+
"uprn": "Un modo facile per scoprire il tuo Numero di Riferimento Proprietà Unica (UPRN) è andare su https://www.findmyaddress.co.uk/ e inserire i dettagli del tuo indirizzo."
16512+
}
16513+
},
1649116514
"args_northherts_gov_uk": {
1649216515
"title": "Configurazione Sorgente",
1649316516
"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/northherts_gov_uk.md.",
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import requests
2+
from bs4 import BeautifulSoup, Tag
3+
from dateutil import parser
4+
from waste_collection_schedule import Collection # type: ignore[attr-defined]
5+
6+
TITLE = "North East Lincolnshire Council"
7+
DESCRIPTION = "Source for North East Lincolnshire Council."
8+
URL = "https://www.nelincs.gov.uk/"
9+
TEST_CASES = {"11042949": {"uprn": 11042949}, "11043243": {"uprn": "11043243"}}
10+
11+
12+
HOW_TO_GET_ARGUMENTS_DESCRIPTION = {
13+
"en": """Fill in your address details at [North East Lincolnshire Council's Find My Address](https://www.nelincs.gov.uk/find-my-address/), the Unique Property Reference Number (UPRN) will be shown in the URL field when you see your collection schedule. (e.g. `https://www.nelincs.gov.uk/?s=DN40+1JU&uprn=11043243` where `11043243` is the UPRN).
14+
15+
Another easy way to discover your Unique Property Reference Number (UPRN) is by going to <https://www.findmyaddress.co.uk/> and entering in your address details.
16+
"""
17+
}
18+
19+
20+
ICON_MAP = {
21+
"household waste": "mdi:trash-can",
22+
"garden": "mdi:leaf",
23+
"paper": "mdi:package-variant",
24+
"cans, plastic & glass": "mdi:recycle",
25+
}
26+
27+
28+
API_URL = "https://www.nelincs.gov.uk/refuse-collection-schedule/"
29+
30+
31+
class Source:
32+
def __init__(self, uprn: str | int):
33+
self._uprn: str | int = uprn
34+
35+
def fetch(self) -> list[Collection]:
36+
args = {"uprn": self._uprn}
37+
38+
r = requests.get(API_URL, params=args)
39+
r.raise_for_status()
40+
41+
soup = BeautifulSoup(r.text, "html.parser")
42+
43+
heading_i = soup.select_one("i.fa-trash")
44+
if not heading_i:
45+
raise ValueError("No collection data found for the provided UPRN.")
46+
collection_div = heading_i.find_parent("div")
47+
if not isinstance(collection_div, Tag):
48+
raise ValueError("No collection data found for the provided UPRN.")
49+
50+
entries = []
51+
for heading, col_list in zip(
52+
collection_div.select("div.h4"), collection_div.select("ul")
53+
):
54+
bin_type = heading.text.strip()
55+
icon = ICON_MAP.get(bin_type.casefold()) # Collection icon
56+
for li in col_list.select("li"):
57+
date_str = li.text.strip()
58+
date_ = parser.parse(date_str, dayfirst=True).date()
59+
entries.append(Collection(date=date_, t=bin_type, icon=icon))
60+
61+
return entries

doc/source/nelincs_gov_uk.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# North East Lincolnshire Council
2+
3+
Support for schedules provided by [North East Lincolnshire Council](https://www.nelincs.gov.uk/), serving North East Lincolnshire Council, UK.
4+
5+
## Configuration via configuration.yaml
6+
7+
```yaml
8+
waste_collection_schedule:
9+
sources:
10+
- name: nelincs_gov_uk
11+
args:
12+
uprn: "UPRN"
13+
14+
```
15+
16+
### Configuration Variables
17+
18+
**uprn**
19+
*(String | Integer) (required)*
20+
21+
## Example
22+
23+
```yaml
24+
waste_collection_schedule:
25+
sources:
26+
- name: nelincs_gov_uk
27+
args:
28+
uprn: "11042949"
29+
30+
```
31+
32+
## How to get the source argument
33+
34+
Fill in your address details at [North East Lincolnshire Council's Find My Address](https://www.nelincs.gov.uk/find-my-address/), the Unique Property Reference Number (UPRN) will be shown in the URL field when you see your collection schedule. (e.g. `https://www.nelincs.gov.uk/?s=DN40+1JU&uprn=11043243` where `11043243` is the UPRN).
35+
36+
Another easy way to discover your Unique Property Reference Number (UPRN) is by going to <https://www.findmyaddress.co.uk/> and entering in your address details.

0 commit comments

Comments
 (0)