Skip to content
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

Error while setting up / Content line could not be parsed into parts #92

Open
oldorfer opened this issue May 23, 2022 · 3 comments
Open

Comments

@oldorfer
Copy link

I'm getting this error while setting up my waste calendar

2022-05-23 12:47:38 WARNING (MainThread) [homeassistant.components.calendar] CalendarEventDevice is deprecated, modify ICalCalendarEventDevice to extend CalendarEntity 2022-05-23 12:47:38 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up ical platform for sensor Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/icalendar/parser.py", line 340, in parts validate_token(name) File "/usr/local/lib/python3.9/site-packages/icalendar/parser.py", line 128, in validate_token raise ValueError(name) ValueError: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform await asyncio.shield(task) File "/config/custom_components/ical/sensor.py", line 47, in async_setup_entry await ical_events.update() File "/config/custom_components/ical/__init__.py", line 130, in update event_list = icalendar.Calendar.from_ical(text.replace("\x00", "")) File "/usr/local/lib/python3.9/site-packages/icalendar/cal.py", line 330, in from_ical name, params, vals = line.parts() File "/usr/local/lib/python3.9/site-packages/icalendar/parser.py", line 352, in parts raise ValueError( ValueError: Content line could not be parsed into parts: '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">': <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

Calendar URL: https://www.friesland.de/abfallkalender/icalendar/ical.html?id=900000275&gebietOwner=20800&strukturID=900009483&year=2022&abfallarten_checked=3;4;77;2

Home Assistant Core 2022.5.5
Home Assistant Supervisor 2022.05.2
Home Assistant OS 8.1
Kernel version 5.15.32-v8
Agent version 1.2.1

@Olen
Copy link
Collaborator

Olen commented May 24, 2022

To me, it looks like what you get is a HTML-document, not an ics-file.

@oldorfer
Copy link
Author

yeah but why?

terminal + curl returns the correct file

feel free to try it

@Olen
Copy link
Collaborator

Olen commented May 24, 2022

I honestly don't know. It could be in the server end, that they don't like the script fetching the URL, or it could be a python library hvaing issues with the URL somehow.

I added a small PR with some more debug-info.

https://github.com/tybritten/ical-sensor-homeassistant/pull/93/files

You can add those lines manually to your installation (in custom_components) and restart HA. Also remember to set log-level to debug mode, at least for the ical-component.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants