-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path__init__.py
executable file
·41 lines (35 loc) · 1.24 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from mycroft.skills.core import FallbackSkill
import requests
from pygame import mixer
import random
import time
class MeaningFallback(FallbackSkill):
"""
A Fallback skill to answer the question about the
meaning of life, the universe and everything.
"""
def __init__(self):
super(MeaningFallback, self).__init__(name='Meaning Fallback')
def initialize(self):
"""
Registers the fallback skill
"""
self.register_fallback(self.handle_fallback, 1)
# Any other initialize code goes here
def handle_fallback(self, message):
print("fart")
#api_url = "http://furby-control.synyx.coffee:3872/cmd/action"
#requests.post(api_url, data='{"params":{"input":7,"index":2,"subindex":0,"specific":0}}')
time.sleep(1)
fart = "/opt/mycroft/skills/skill-fallback-fart.hackyouroffice/fart-0%d.mp3" % (random.randint(1, 8))
mixer.init()
mixer.music.load(fart)
mixer.music.play()
def shutdown(self):
"""
Remove this skill from list of fallback skills.
"""
self.remove_fallback(self.handle_fallback)
super(MeaningFallback, self).shutdown()
def create_skill():
return MeaningFallback()