Skip to content

Commit 284fdb1

Browse files
authored
Merge pull request #1883 from robbrad/march-2026-release
March 2026 Release
2 parents f6cbad7 + 58eb0ff commit 284fdb1

82 files changed

Lines changed: 1773 additions & 1626 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ha_compatibility_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ jobs:
181181
182182
- name: Upload HA log (always)
183183
if: always()
184-
uses: actions/upload-artifact@v6
184+
uses: actions/upload-artifact@v7
185185
with:
186186
name: ha-log-${{ matrix.ha_version }}
187187
path: home-assistant.log

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,13 @@ jobs:
9090
uses: actions/checkout@v6
9191

9292
- name: Login to Docker Hub
93-
uses: docker/login-action@v3
93+
uses: docker/login-action@v4
9494
with:
9595
username: ${{ secrets.DOCKER_USERNAME }}
9696
password: ${{ secrets.DOCKER_API_KEY }}
9797

9898
- name: Build and push Docker image
99-
uses: docker/build-push-action@v6
99+
uses: docker/build-push-action@v7
100100
with:
101101
context: ./uk_bin_collection_api_server
102102
push: true

poetry.lock

Lines changed: 214 additions & 333 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ issues = "https://github.com/robbrad/UKBinCollectionData/issues"
2424
requires = ["poetry-core>=1.2.0"]
2525
build-backend = "poetry.core.masonry.api"
2626

27-
[tool.poetry.dev-dependencies]
27+
[tool.poetry.group.dev.dependencies]
2828
black = "*"
2929
coverage = "*"
3030
flake8 = "*"

uk_bin_collection/tests/input.json

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,14 +1344,11 @@
13441344
"LAD24CD": "E07000121"
13451345
},
13461346
"LeedsCityCouncil": {
1347-
"house_number": "1",
1348-
"postcode": "LS6 2SE",
13491347
"skip_get_url": true,
13501348
"uprn": "72506983",
13511349
"url": "https://www.leeds.gov.uk/residents/bins-and-recycling/check-your-bin-day",
1352-
"web_driver": "http://selenium:4444",
13531350
"wiki_name": "Leeds",
1354-
"wiki_note": "Pass the house number, postcode, and UPRN. This parser requires a Selenium webdriver.",
1351+
"wiki_note": "Pass the UPRN.",
13551352
"LAD24CD": "E08000035"
13561353
},
13571354
"LeicesterCityCouncil": {
@@ -1420,6 +1417,14 @@
14201417
"wiki_note": "Pass the UPRN. You can find it using [FindMyAddress](https://www.findmyaddress.co.uk/search).",
14211418
"LAD24CD": "E09000009"
14221419
},
1420+
"LondonBoroughHammersmithandFulham": {
1421+
"postcode": "W12 0BQ",
1422+
"url": "https://www.lbhf.gov.uk/",
1423+
"wiki_command_url_override": "https://www.lbhf.gov.uk/",
1424+
"wiki_name": "Hammersmith & Fulham",
1425+
"wiki_note": "Pass only the property postcode",
1426+
"LAD24CD": "E09000013"
1427+
},
14231428
"LondonBoroughHarrow": {
14241429
"uprn": "100021298754",
14251430
"url": "https://www.harrow.gov.uk",
@@ -1843,6 +1848,15 @@
18431848
"wiki_note": "Pass the UPRN. You can find it using [FindMyAddress](https://www.findmyaddress.co.uk/search).",
18441849
"LAD24CD": "E06000057"
18451850
},
1851+
"NorthWarwickshireBoroughCouncil": {
1852+
"uprn": "10001179576",
1853+
"skip_get_url": true,
1854+
"url": "https://www.northwarks.gov.uk",
1855+
"web_driver": "http://selenium:4444",
1856+
"wiki_name": "North Warwickshire",
1857+
"wiki_note": "Pass the UPRN. You can find it using [FindMyAddress](https://www.findmyaddress.co.uk/search).",
1858+
"LAD24CD": "E07000220"
1859+
},
18461860
"NorwichCityCouncil": {
18471861
"house_number": "2",
18481862
"postcode": "NR2 3TT",

uk_bin_collection/uk_bin_collection/councils/BarkingDagenham.py

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,23 +47,7 @@ def parse_data(self, page: str, **kwargs) -> dict:
4747
# Close popup if it exists
4848
driver.switch_to.active_element.send_keys(Keys.ESCAPE)
4949

50-
# Handle cookie banner if present
51-
wait = WebDriverWait(driver, 60)
52-
try:
53-
cookie_button = wait.until(
54-
EC.element_to_be_clickable(
55-
(
56-
By.CSS_SELECTOR,
57-
".agree-button.eu-cookie-compliance-secondary-button.button.button--small",
58-
)
59-
),
60-
message="Cookie banner not found",
61-
)
62-
cookie_button.click()
63-
print("Cookie banner clicked.")
64-
time.sleep(1) # Brief pause to let banner disappear
65-
except (TimeoutException, NoSuchElementException):
66-
print("No cookie banner appeared or selector failed.")
50+
wait = WebDriverWait(driver, 10)
6751

6852
# Enter postcode
6953
print("Looking for postcode input...")
@@ -84,7 +68,7 @@ def parse_data(self, page: str, **kwargs) -> dict:
8468
EC.element_to_be_clickable((By.ID, "address")),
8569
message="Address dropdown not found",
8670
)
87-
71+
8872
dropdown = Select(address_select)
8973

9074
found = False

uk_bin_collection/uk_bin_collection/councils/BarnsleyMBCouncil.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def parse_data(self, page: str, **kwargs: Any) -> Dict[str, Any]:
7171
"sec-fetch-site": "same-origin",
7272
"sec-fetch-user": "?1",
7373
"upgrade-insecure-requests": "1",
74-
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.5993.118 Safari/537.36",
74+
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36",
7575
}
7676
form_data = {
7777
"personInfo.person1.HouseNumberOrName": "",

uk_bin_collection/uk_bin_collection/councils/BasingstokeCouncil.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def parse_data(self, page: str, **kwargs) -> dict:
3636
"Sec-Fetch-Mode": "navigate",
3737
"Sec-Fetch-Site": "cross-site",
3838
"Sec-Fetch-User": "?1",
39-
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.5845.188 Safari/537.36",
39+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36",
4040
}
4141

4242
response = requests.get(

uk_bin_collection/uk_bin_collection/councils/BathAndNorthEastSomersetCouncil.py

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import json
2+
import ssl
3+
24
import requests
5+
import urllib3
36
from bs4 import BeautifulSoup
7+
48
from uk_bin_collection.uk_bin_collection.common import *
59
from uk_bin_collection.uk_bin_collection.get_bin_data import AbstractGetBinDataClass
6-
import ssl
7-
import urllib3
810

911

1012
class CustomHttpAdapter(requests.adapters.HTTPAdapter):
@@ -45,7 +47,7 @@ def parse_data(self, page: str, **kwargs) -> dict:
4547
"Sec-Fetch-Dest": "empty",
4648
"Sec-Fetch-Mode": "cors",
4749
"Sec-Fetch-Site": "same-origin",
48-
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.5845.188 Safari/537.36",
50+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36",
4951
"X-Requested-With": "XMLHttpRequest",
5052
}
5153

@@ -56,7 +58,7 @@ def parse_data(self, page: str, **kwargs) -> dict:
5658

5759
requests.packages.urllib3.disable_warnings()
5860
response = session.get(
59-
f"https://www.bathnes.gov.uk/webapi/api/BinsAPI/v2/getbartecroute/{user_uprn}/true",
61+
f"https://api.bathnes.gov.uk/webapi/api/BinsAPI/v2/BartecFeaturesandSchedules/CollectionSummary/{user_uprn}",
6062
headers=headers,
6163
)
6264
if response.text == "":
@@ -68,30 +70,14 @@ def parse_data(self, page: str, **kwargs) -> dict:
6870

6971
data = {"bins": []}
7072

71-
if len(json_data["residualNextDate"]) > 0:
72-
dict_data = {
73-
"type": "Black Rubbish Bin",
74-
"collectionDate": datetime.strptime(
75-
json_data["residualNextDate"], "%Y-%m-%dT%H:%M:%S"
76-
).strftime(date_format),
77-
}
78-
data["bins"].append(dict_data)
79-
if len(json_data["recyclingNextDate"]) > 0:
80-
dict_data = {
81-
"type": "Recycling Containers",
82-
"collectionDate": datetime.strptime(
83-
json_data["recyclingNextDate"], "%Y-%m-%dT%H:%M:%S"
84-
).strftime(date_format),
85-
}
86-
data["bins"].append(dict_data)
87-
if len(json_data["organicNextDate"]) > 0:
88-
dict_data = {
89-
"type": "Garden Waste",
90-
"collectionDate": datetime.strptime(
91-
json_data["organicNextDate"], "%Y-%m-%dT%H:%M:%S"
92-
).strftime(date_format),
93-
}
94-
data["bins"].append(dict_data)
73+
for collection in json_data:
74+
collection_date = datetime.fromisoformat(collection["nextCollectionDate"])
75+
for feature in collection["features"]:
76+
dict_data = {
77+
"type": feature["featureDisplayName"],
78+
"collectionDate": collection_date.strftime(date_format),
79+
}
80+
data["bins"].append(dict_data)
9581

9682
data["bins"].sort(
9783
key=lambda x: datetime.strptime(x.get("collectionDate"), date_format)

uk_bin_collection/uk_bin_collection/councils/BedfordshireCouncil.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def parse_data(self, page: str, **kwargs) -> dict:
2929
"Origin": "https://www.centralbedfordshire.gov.uk",
3030
"Referer": "https://www.centralbedfordshire.gov.uk/info/163/bins_and_waste_collections_-_check_bin_collection_day",
3131

32-
"User-Agent": "Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.7968.1811 Mobile Safari/537.36",
32+
"User-Agent": "Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Mobile Safari/537.36",
3333
}
3434

3535
files = {

0 commit comments

Comments
 (0)