From efba504d84f706e3fb69fe986632e61bd6559581 Mon Sep 17 00:00:00 2001 From: mampfes Date: Fri, 3 Dec 2021 06:35:04 +0100 Subject: [PATCH] fix fault in ics scraper caused by next year handing and therefore only appears in december --- .../waste_collection_schedule/source/ics.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/custom_components/waste_collection_schedule/waste_collection_schedule/source/ics.py b/custom_components/waste_collection_schedule/waste_collection_schedule/source/ics.py index 0d94b0619..2b2d2a4b0 100644 --- a/custom_components/waste_collection_schedule/waste_collection_schedule/source/ics.py +++ b/custom_components/waste_collection_schedule/waste_collection_schedule/source/ics.py @@ -159,7 +159,8 @@ def fetch(self): if now.month == 12: # also get data for next year if we are already in december url = self._url.replace("{%Y}", str(now.year + 1)) - self._params[self._year_field] = str(now.year + 1) + if self._year_field is not None: + self._params[self._year_field] = str(now.year + 1) try: entries.extend(self.fetch_url(url), self._params)