-
-
Notifications
You must be signed in to change notification settings - Fork 769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding support for Lipizzanerheimat App, Austria #3411
base: master
Are you sure you want to change the base?
Conversation
TEST_CASES = { | ||
# "Köflach - Debug": {"debug": True}, | ||
"Köflach - Endgasse": {"town": "Köflach", "street": "Endgasse"}, | ||
"Voitsberg - Bahnweg": {"garbage_calendar_id": 2437, }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Voitsberg - Bahnweg seems to fail
|
||
HOW_TO_GET_ARGUMENTS_DESCRIPTION = { # Optional dictionary to describe how to get the arguments, will be shown in the GUI configuration form above the input fields, does not need to be translated in all languages | ||
"en": "Open the Lipizzanerheimat app, login or use guest mode, select your town, go to the garbage calendar view and select the street you want to get the garbage collection dates for. You can either provide the calendar name in the lower center, the street name and town as written in the dropdown or provide the garbage_calendar_id directly.", | ||
"de": "Öffnen Sie die Lipizzanerheimat-App, melden Sie sich an oder nutzen Sie den Gastmodus, wählen Sie Ihre Stadt aus, gehen Sie zur Ansicht des Müllkalenders und wählen Sie die Straße aus, für die Sie die Müllabfuhrtermine erhalten möchten. Sie können entweder den Kalendernamen in der unteren Mitte, den Straßennamen und die Stadt, wie sie im Dropdown-Menü geschrieben sind, oder direkt die garbage_calendar_id angeben.", "it": "COME OTTENERE GLI ARGOMENTI", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove "it": "COME OTTENERE GLI ARGOMENTI",
def sha1(self, input_str): | ||
return hashlib.sha1(input_str.encode('utf-8')).hexdigest() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redefinition can be removed
|
||
def _first_setup(self): | ||
|
||
r = requests.get(API_URL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this request? r
is never accessed, and you don't use a session so this does just nothing but an unnecessary web request
def __init__(self, garbage_calendar_id: int | None = None, street: str | None = None, town: str | None = None, map_name: str | None = None): | ||
|
||
self.items = [] | ||
self.icons = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
icons should be a dict
not a list
return next((c['garbage_calendar_id'] | ||
for c in calendarData['garbage_calendars'] if c['garbage_calendar_title'] == self.map_name), None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be better to raise an Exception instead of returning None? You could even provide alternative map_name
s when raising SourceArgumentNotFoundWithSuggestions
return next((c['garbage_calendars_available'][0] | ||
for c in calendarData['street_structure'] if c['garbage_calendar_street'] == self.street), None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
Add support for Lipizzanerheimat, Austria
Format documentation
reformatting + ./update_docu_links.py
Uses guest credentials that were provided in the code.