feat: remove any alarm given an action
Signed-off-by: thiswillbeyourgithub <github@32mail.33mail.com>
This commit is contained in:
parent
4ca3a4ef20
commit
03c16d6c99
1 changed files with 6 additions and 1 deletions
|
@ -351,6 +351,11 @@ class Manager():
|
|||
def cancel_alarm(self, time, action):
|
||||
"""Unqueue an alarm."""
|
||||
try:
|
||||
if time is None:
|
||||
for i, al in enumerate(self._alarms):
|
||||
if self._alarms[i][1] == action:
|
||||
self._alarms.remove(self._alarms[i])
|
||||
else:
|
||||
self._alarms.remove((time, action))
|
||||
except:
|
||||
return False
|
||||
|
|
Loading…
Reference in a new issue