-
Hey there, Sorry to bug with you a silly question, but if I'm able to figure this out, I will happily submit a PR to add this to the documentation. I am trying to add an alarm to an event, but am having a hard time figuring out how to actually set it. Let's take your default code to create a simple ics file with a single event:
If I were to add an alarm to this event, the docs say there's an alarms parameter for each event:
So I know I need to specify it like Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Have you tried creating a simple instance of an appropriate alarm? The interface is documented here, also check out the description of the constructor parameters. Then put your event into a list (which is an "iterable") and use that for your events variable.
That should also be what you get when you parse an event with the trigger time you mentioned in your post. An alternative way of answering "how do I replicate XY with ics.py" is creating an appropriate event with your favourite calendaring GUI, exporting it to ics, and checking which objects ics.py gives you when you parse that file. You can then simply create the same objects programmatically and change them as needed. |
Beta Was this translation helpful? Give feedback.
-
Thanks, I solved the issue! |
Beta Was this translation helpful? Give feedback.
Have you tried creating a simple instance of an appropriate alarm? The interface is documented here, also check out the description of the constructor parameters. Then put your event into a list (which is an "iterable") and use that for your events variable.
Something like the following might work:
That should also be what you get when you parse an event with the trigger time you mentioned in your post.
An alternative way of answering "how do I replicate XY with ics.py" is creating an appropriate event with your favourite calendaring GUI, exporting it to ics, and checking which objects ics.py gives you when you parse that file. You c…