added template files. Added the start of timer.py
This commit is contained in:
parent
15d1a0b58b
commit
698edf58f6
0
skills/alarms.py
Normal file
0
skills/alarms.py
Normal file
0
skills/calendar.py
Normal file
0
skills/calendar.py
Normal file
0
skills/email.py
Normal file
0
skills/email.py
Normal file
0
skills/gpt.py
Normal file
0
skills/gpt.py
Normal file
0
skills/reminders.py
Normal file
0
skills/reminders.py
Normal file
33
skills/timers.py
Normal file
33
skills/timers.py
Normal file
@ -0,0 +1,33 @@
|
||||
|
||||
|
||||
class Timers:
|
||||
def __init__(self):
|
||||
self.trigger_phrase = "timer"
|
||||
self.timers = {}
|
||||
|
||||
def _add_timer(self, time, name):
|
||||
self.timers[name] = time
|
||||
# use https://schedule.readthedocs.io/en/stable/examples.html#run-a-job-once to trigger self._trigger_timer()
|
||||
|
||||
def _remove_timer(self, name):
|
||||
del self.timers[name]
|
||||
|
||||
def _trigger_timer(self, name):
|
||||
if name in self.timers:
|
||||
pass
|
||||
#TODO: send ntfy.sh to device
|
||||
#TODO: play timer done sound
|
||||
|
||||
|
||||
def run(self, query):
|
||||
if "add" in query:
|
||||
time = 0 #TODO: Natural Language parse time out of phrase
|
||||
self._add_timer(time)
|
||||
return True # Return true to indicate success
|
||||
if "remove" in query:
|
||||
time = 0 #TODO: Natural Language parse time out of phrase
|
||||
self._remove_timer(time)
|
||||
return True
|
||||
return False # Return false to indicate failure
|
||||
|
||||
|
0
skills/todos.py
Normal file
0
skills/todos.py
Normal file
0
skills/weather.py
Normal file
0
skills/weather.py
Normal file
0
skills/wolfram.py
Normal file
0
skills/wolfram.py
Normal file
Loading…
Reference in New Issue
Block a user