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

Support for multiple Calendars in one ICS file? #216

Open
JVTEAM opened this issue Jan 4, 2025 · 2 comments
Open

Support for multiple Calendars in one ICS file? #216

JVTEAM opened this issue Jan 4, 2025 · 2 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@JVTEAM
Copy link

JVTEAM commented Jan 4, 2025

I combine a couple calendars into one for another use. When I try to use this plugin I get this error.

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 960, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1318, in async_device_update
await self.async_update()
File "/config/custom_components/ics_calendar/calendar.py", line 220, in async_update
await self.data.async_update()
File "/config/custom_components/ics_calendar/calendar.py", line 343, in async_update
self.parser.set_content(self._calendar_data.get())
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/ics_calendar/parsers/parser_rie.py", line 33, in set_content
self._calendar = Calendar.from_ical(content)
~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/icalendar/cal.py", line 487, in from_ical
raise ValueError(cls._format_error(
'Found multiple components where only one is allowed', st))

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 960, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1318, in async_device_update
await self.async_update()
File "/config/custom_components/ics_calendar/calendar.py", line 220, in async_update
await self.data.async_update()
File "/config/custom_components/ics_calendar/calendar.py", line 343, in async_update
self.parser.set_content(self._calendar_data.get())
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/ics_calendar/parsers/parser_ics.py", line 33, in set_content
self._calendar = Calendar(re.sub(self._re_method, "", content))
~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/ics/icalendar.py", line 66, in init
raise NotImplementedError(
'Multiple calendars in one file are not supported by this method. Use ics.Calendar.parse_multiple()')
NotImplementedError: Multiple calendars in one file are not supported by this method. Use ics.Calendar.parse_multiple()

@franc6
Copy link
Owner

franc6 commented Jan 4, 2025

Are you OK with having both calendars show up as a single calendar in HA? I ask because anything else would require either a funky configuration, which relies on the order of calendars in the ICS file remaining constant (probably not a big deal), or really twisting the code around to do it. I won't go the latter route, and I'm hesitant to do the former -- I expect this is a very unusual use case, and I don't want to make my own maintenance problems harder. :)

Please note that anything will be a while, as new features are a low priority compared to what's in the TODO.md file.

@franc6 franc6 added enhancement New feature or request question Further information is requested labels Jan 4, 2025
@JVTEAM
Copy link
Author

JVTEAM commented Jan 5, 2025

Are you OK with having both calendars show up as a single calendar in HA? I ask because anything else would require either a funky configuration, which relies on the order of calendars in the ICS file remaining constant (probably not a big deal), or really twisting the code around to do it. I won't go the latter route, and I'm hesitant to do the former -- I expect this is a very unusual use case, and I don't want to make my own maintenance problems harder. :)

Please note that anything will be a while, as new features are a low priority compared to what's in the TODO.md file.

Yes, I combine them because I use Dakboard on a wall tablet that won't allow more than one calendar on a free account....so I manually combine them all via a script. I have no need to keep them separate on Home Assistant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants