diff --git a/custom_components/waste_collection_schedule/waste_collection_schedule/source/heidelberg_de.py b/custom_components/waste_collection_schedule/waste_collection_schedule/source/heidelberg_de.py index 647b15f78..ede56b7c4 100644 --- a/custom_components/waste_collection_schedule/waste_collection_schedule/source/heidelberg_de.py +++ b/custom_components/waste_collection_schedule/waste_collection_schedule/source/heidelberg_de.py @@ -199,7 +199,7 @@ def __init__( self._even_house_number = even_house_number @staticmethod - def get_available_streets() -> list[str]: + def _get_available_streets() -> list[str]: streets_request = requests.get(STREETNAMES_API_URL) streets_request.raise_for_status() @@ -216,7 +216,7 @@ def _extract_collection_data(self, raw_collection_data): for waste_type in WASTE_TYPES: if waste_type == WASTE_TYPES["christmas"]: collection_date = date_parser.parse( - raw_collection_data[waste_type][0]["collection_date"] + raw_collection_data[waste_type][0]["collection_date"], ignoretz=True ) ruleset = rruleset() ruleset.rdate(collection_date) @@ -278,7 +278,7 @@ def fetch(self) -> list[Collection]: raise SourceArgumentRequiredWithSuggestions( "street", "It's required to specify your street.", - self.get_available_streets(), + self._get_available_streets(), ) collections_request = requests.get(self._api_url) @@ -287,7 +287,7 @@ def fetch(self) -> list[Collection]: if len(raw_collection_data["collections"]) == 0: raise SourceArgumentNotFoundWithSuggestions( - "street", self._street, self.get_available_streets() + "street", self._street, self._get_available_streets() ) collection_data = self._extract_collection_data(raw_collection_data) @@ -306,9 +306,4 @@ def fetch(self) -> list[Collection]: ) ) - return entries - - -CONFIG_FLOW_TYPES = { - "street": {"type": "SELECT", "values": Source.get_available_streets()} -} + return entries \ No newline at end of file diff --git a/doc/source/heidelberg_de.md b/doc/source/heidelberg_de.md index 34922cfb1..1695ce0c1 100644 --- a/doc/source/heidelberg_de.md +++ b/doc/source/heidelberg_de.md @@ -17,7 +17,7 @@ waste_collection_schedule: ### Configuration Variables **street** -*(string) (required)* The street you want to get the waste collection schedule for. This value must match with an [entry from the API](https://garbage.datenplattform.heidelberg.de/streetnames). If you use the GUI to set up this source, we automatically get all available street names and provide you a drop-down list where you can choose the appropriate entry. +*(string) (required)* The street you want to get the waste collection schedule for. This value must match with an [entry from the API](https://garbage.datenplattform.heidelberg.de/streetnames). If you use the GUI to set up this source and your input doesn't match, we automatically suggest you entries based on the API response. **collect_residual_waste_weekly** *(bool)* By default, the city collects residual waste on a weekly basis. If you decided to switch to a bi-weekly schedule to save some money, set this value to False. If you live on a rural street where the waste is only being collected biweekly, you don't need to change anything here as it's being taken into account automatically.