mirror of
https://github.com/sascha-hemi/hacs_waste_collection_schedule.git
synced 2026-03-21 02:04:22 +01:00
@@ -21,10 +21,10 @@ schedules_url = "https://ecoharmonogram.pl/api/api.php?action=getSchedules"
|
||||
|
||||
|
||||
class Source:
|
||||
def __init__(self, town_input, street_input, house_number_input):
|
||||
self.town_input = town_input
|
||||
self.street_input = street_input
|
||||
self.house_number_input = house_number_input
|
||||
def __init__(self, town, street=None, house_number=None):
|
||||
self.town_input = town
|
||||
self.street_input = street
|
||||
self.house_number_input = house_number
|
||||
|
||||
def fetch(self):
|
||||
town_response = requests.get(towns_url, headers=headers)
|
||||
|
||||
@@ -11,9 +11,9 @@ waste_collection_schedule:
|
||||
sources:
|
||||
- name: ecoharmonogram_pl
|
||||
args:
|
||||
town_input: town_input
|
||||
street_input: street_input
|
||||
house_number_input: house_number_input
|
||||
town: town
|
||||
street: street
|
||||
house_number: house_number
|
||||
```
|
||||
|
||||
## Example
|
||||
@@ -23,11 +23,12 @@ waste_collection_schedule:
|
||||
sources:
|
||||
- name: ecoharmonogram_pl
|
||||
args:
|
||||
town_input: Krzeszowice
|
||||
street_input: Wyki
|
||||
house_number_input:
|
||||
town: Krzeszowice
|
||||
street: Wyki
|
||||
```
|
||||
|
||||
Worth to mention that street and house_number are optional parameters if your city doesn't require one.
|
||||
|
||||
## Keep in mind
|
||||
Ecoharmonogram data is filled by each city, so that some towns doesn't require street name while some does.
|
||||
Also, together with garbage collection schedule you may see also payment reminders or other events.
|
||||
|
||||
Reference in New Issue
Block a user