Skip to content

How to: add an alarm to an event? #277

Answered by N-Coder
firasm asked this question in Q&A
Discussion options

You must be logged in to vote

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:

e.alarms = [DisplayAlarm(trigger=timedelta(hours=-2))]

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…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by C4ptainCrunch
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #256 on January 17, 2021 10:51.