I Have A Problem With:
The integration in general
What's Your Problem
Found an error this morning in the logs when the integration was trying to fetch the schedule from the server
Feb 29 01:21:31 smarthome hass[7852]: ValueError: day is out of range for month
Obvisously "end_date" is set to "same day next year", with doesn't work for February 29th
end_date = start_date.replace(year=start_date.year + 1)
Source (if relevant)
ICS
Logs
Feb 29 01:21:31 smarthome hass[7852]: 2024-02-29 01:21:31.427 ERROR (SyncWorker_9) [waste_collection_schedule.source_shell] fetch failed for source ICS:
Feb 29 01:21:31 smarthome hass[7852]: Traceback (most recent call last):
Feb 29 01:21:31 smarthome hass[7852]: File "/home/homeassistant/.homeassistant/custom_components/waste_collection_schedule/waste_collection_schedule/source_shell.py", line 134, in fetch
Feb 29 01:21:31 smarthome hass[7852]: entries = self._source.fetch()
Feb 29 01:21:31 smarthome hass[7852]: ^^^^^^^^^^^^^^^^^^^^
Feb 29 01:21:31 smarthome hass[7852]: File "/home/homeassistant/.homeassistant/custom_components/waste_collection_schedule/waste_collection_schedule/source/ics.py", line 179, in fetch
Feb 29 01:21:31 smarthome hass[7852]: return self.fetch_url(self._url, self._params)
Feb 29 01:21:31 smarthome hass[7852]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 29 01:21:31 smarthome hass[7852]: File "/home/homeassistant/.homeassistant/custom_components/waste_collection_schedule/waste_collection_schedule/source/ics.py", line 204, in fetch_url
Feb 29 01:21:31 smarthome hass[7852]: return self._convert(r.text)
Feb 29 01:21:31 smarthome hass[7852]: ^^^^^^^^^^^^^^^^^^^^^
Feb 29 01:21:31 smarthome hass[7852]: File "/home/homeassistant/.homeassistant/custom_components/waste_collection_schedule/waste_collection_schedule/source/ics.py", line 215, in _convert
Feb 29 01:21:31 smarthome hass[7852]: dates = self._ics.convert(data)
Feb 29 01:21:31 smarthome hass[7852]: ^^^^^^^^^^^^^^^^^^^^^^^
Feb 29 01:21:31 smarthome hass[7852]: File "/home/homeassistant/.homeassistant/custom_components/waste_collection_schedule/waste_collection_schedule/service/ICS.py", line 39, in convert
Feb 29 01:21:31 smarthome hass[7852]: end_date = start_date.replace(year=start_date.year + 1)
Feb 29 01:21:31 smarthome hass[7852]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 29 01:21:31 smarthome hass[7852]: ValueError: day is out of range for month
Relevant Configuration
waste_collection_schedule:
sources:
- name: ics
args:
url: "https://kundenportal.avl-lb.de/WasteManagementLudwigsburg/WasteManagementServiceServlet?ApplicationName=Calendar&SubmitAction=sync&StandortID=xxxxxxxxx&AboID=yyyy&Fra=BT;RT;PT;LT;GT"
Checklist Source Error
Checklist Sensor Error
Required
I Have A Problem With:
The integration in general
What's Your Problem
Found an error this morning in the logs when the integration was trying to fetch the schedule from the server
Feb 29 01:21:31 smarthome hass[7852]: ValueError: day is out of range for monthObvisously "end_date" is set to "same day next year", with doesn't work for February 29th
end_date = start_date.replace(year=start_date.year + 1)Source (if relevant)
ICS
Logs
Relevant Configuration
Checklist Source Error
Checklist Sensor Error
Required