|
|
@@ -58,8 +58,22 @@ class Wunderlist(base.BaseFunction):
|
|
|
return
|
|
|
self.initialized = True
|
|
|
|
|
|
+ def _get_list(self):
|
|
|
+ if self.list_name:
|
|
|
+ return self.list_name
|
|
|
+
|
|
|
+ else:
|
|
|
+ list_name = ears.listen(pause_threshold=1, preferred_phrases=self.client.lists.keys()).lower()
|
|
|
+ if list_name in self.client.lists:
|
|
|
+ return list_name
|
|
|
+ else:
|
|
|
+ return None
|
|
|
+
|
|
|
def call(self, **_):
|
|
|
- tts.tts('ready')
|
|
|
+ list_name = self._get_list()
|
|
|
+ if list_name is None:
|
|
|
+ clips.play(clips.Clips.FAILURE)
|
|
|
+ return
|
|
|
|
|
|
lines, terminator = ears.listen_until_terminated(timeout=_LISTEN_TIMEOUT, preferred_phrases=_GROCERIES)
|
|
|
|