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 when trying to setup ical platform for sensor #125

Open
CaptainSweatpants opened this issue Jul 1, 2023 · 2 comments
Open

Error when trying to setup ical platform for sensor #125

CaptainSweatpants opened this issue Jul 1, 2023 · 2 comments

Comments

@CaptainSweatpants
Copy link

This just started about a week ago.

Home Assistant 2023.6.3
Supervisor 2023.06.4
Operating System 10.2
Frontend 20230608.0 - latest

`Logger: homeassistant.components.sensor
Source: custom_components/ical/init.py:135
Integration: Sensor (documentation, issues)
First occurred: 10:28:29 AM (1 occurrences)
Last logged: 10:28:29 AM

Error while setting up ical platform for sensor
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/icalendar/parser.py", line 339, in parts
validate_token(name)
File "/usr/local/lib/python3.11/site-packages/icalendar/parser.py", line 128, in validate_token
raise ValueError(name)
ValueError: <!doctype html><title>injixo</title><script defer="defer" src="/app/runtime.9563b1.min.js"></script><script defer="defer" src="/app/vendor.f05e88.min.js"></script><script defer="defer" src="/app/main.7547a3.min.js"></script>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 320, 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 135, in update
event_list = icalendar.Calendar.from_ical(text.replace("\x00", ""))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/icalendar/cal.py", line 328, in from_ical
name, params, vals = line.parts()
^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/icalendar/parser.py", line 351, in parts
raise ValueError(
ValueError: Content line could not be parsed into parts: '<!doctype html><title>injixo</title><script defer="defer" src="/app/runtime.9563b1.min.js"></script><script defer="defer" src="/app/vendor.f05e88.min.js"></script><script defer="defer" src="/app/main.7547a3.min.js"></script>

': <!doctype html><title>injixo</title><script defer="defer" src="/app/runtime.9563b1.min.js"></script><script defer="defer" src="/app/vendor.f05e88.min.js"></script><script defer="defer" src="/app/main.7547a3.min.js"></script>

`

Any ideas what broke?

@tybritten
Copy link
Owner

That value error looks like the format of your feed changed. try using wget or curl on the url for your calendar feed and see if its in the proper ical format.

@CaptainSweatpants
Copy link
Author

CaptainSweatpants commented Jul 3, 2023

So, to check for the ical validation i used icalendar.org’s ical validator and it returned
File Size: 549 lines, 15910 bytes
Number of events found: 75
Number of timezones found: 1
Success! No errors found.

I also have no issues importing this ical calendar URL with any of my other email platforms such as AppleMail or Outlook. I have also tried the custom component “Icalendar” and its also working to import my ical file. It uses the “rie” parser. It lacks breaking my events into sensors as this component does, but for my purposes i didnt need that feature. But this does lean me toward the issue being with this component specifically.

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