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,7 +351,12 @@ class Manager():
|
|||
def cancel_alarm(self, time, action):
|
||||
"""Unqueue an alarm."""
|
||||
try:
|
||||
self._alarms.remove((time, action))
|
||||
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
|
||||
return True
|
||||
|
|
Loading…
Reference in a new issue