-
Notifications
You must be signed in to change notification settings - Fork 95
Expand file tree
/
Copy pathexamplePlugin.py
More file actions
24 lines (19 loc) · 803 Bytes
/
examplePlugin.py
File metadata and controls
24 lines (19 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/python
# -*- coding: utf-8 -*-
from plugin import *
class examplePlugin(Plugin):
@register("de-DE", ".*Sinn.*Leben.*")
@register("en-US", ".*Meaning.*Life.*")
def meaningOfLife(self, speech, language):
if language == 'de-DE':
answer = self.ask(u"Willst du das wirklich wissen?")
self.say(u"Du hast \"{0}\" gesagt!".format(answer))
else:
self.say("I shouldn't tell you!")
self.complete_request()
@register("de-DE", ".*standort.*test.*")
@register("en-US", ".*location.*test.*")
def locationTest(self, speech, language):
location = self.getCurrentLocation(force_reload=True)
self.say(u"lat: {0}, long: {1}".format(location.latitude, location.longitude))
self.complete_request()