Skip to content

Commit

Permalink
Fix postcode parameter translation for Windsor and Maidenhead, UK sou…
Browse files Browse the repository at this point in the history
…rce (#2891)

* Add type info back to (now optional) postcode argument

* Fix postcode parameter translation for Windsor and Maidenhead, UK source

* Update translations JSON
  • Loading branch information
marcjay authored Oct 22, 2024
1 parent 20c46e2 commit 889d24f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15998,7 +15998,7 @@
"description": "Konfiguriere deinen Service Provider. Mehr details: https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/rbwm_gov_uk.md",
"data": {
"calendar_title": "Kalender Titel",
"postcode": "(Leave Empty)",
"postcode": "(Leer lassen)",
"uprn": "UPRN"
},
"data_description": {
Expand All @@ -16011,7 +16011,7 @@
"description": "Konfiguriere deinen Service Provider. Mehr details: https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/rbwm_gov_uk.md",
"data": {
"calendar_title": "Kalender Titel",
"postcode": "(Leave Empty)",
"postcode": "(Leer lassen)",
"uprn": "UPRN"
},
"data_description": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16011,7 +16011,7 @@
"description": "Configure your service provider. More details: https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/rbwm_gov_uk.md.",
"data": {
"calendar_title": "Calendar Title",
"postcode": "(Leer lassen)",
"postcode": "(Leave Empty)",
"uprn": "UPRN"
},
"data_description": {
Expand All @@ -16024,7 +16024,7 @@
"description": "Configure your service provider. More details: https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/rbwm_gov_uk.md.",
"data": {
"calendar_title": "Calendar Title",
"postcode": "(Leer lassen)",
"postcode": "(Leave Empty)",
"uprn": "UPRN"
},
"data_description": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from typing import Optional

import requests
from bs4 import BeautifulSoup
from dateutil.parser import parse
Expand All @@ -22,11 +24,11 @@

PARAM_TRANSLATIONS = {
"de": {
"postcode": "(Leave Empty)",
"postcode": "(Leer lassen)",
"uprn": "UPRN",
},
"en": {
"postcode": "(Leer lassen)",
"postcode": "(Leave Empty)",
"uprn": "UPRN",
},
"it": {
Expand All @@ -46,7 +48,7 @@

class Source:
# postcode was previously required by this source. This is no longer the case but argument kept for backwards compatibility
def __init__(self, uprn: str | int, postcode=None):
def __init__(self, uprn: str | int, postcode: Optional[str] = None):
self._uprn: str = str(uprn).zfill(12)

def fetch(self):
Expand Down

0 comments on commit 889d24f

Please sign in to comment.