38 lines
956 B
Python
38 lines
956 B
Python
import logging
|
|
import time
|
|
import schedule
|
|
|
|
import config
|
|
|
|
from src.rhasspy import rhasspy_mqtt as yoda_listener
|
|
from src.rhasspy import Rhasspy
|
|
from src.ratatouille import Ratatouille
|
|
from src.mpd import Mpd
|
|
from src.hass import Hass
|
|
from src.httpServer import get_server
|
|
from src.intent import AlexaIntent
|
|
|
|
logging.basicConfig(
|
|
level=10,
|
|
format="%(asctime)s %(filename)s:%(lineno)s %(levelname)s %(message)s"
|
|
)
|
|
|
|
IP = "10.10.10.11"
|
|
PORT = 5555
|
|
|
|
walle = Hass(config.hass_url, config.hass_token)
|
|
yoda = None #Rhasspy(config.rhasspy_url)
|
|
mopidy = Mpd('10.10.10.10', yoda)
|
|
ratatouille = Ratatouille(yoda, walle, mopidy, schedule)
|
|
alexa = AlexaIntent() # we are not doing any request to the evil amazon but we are using one of its dataset
|
|
|
|
def answer(sentence):
|
|
return ratatouille.parseAlexa(alexa.predict(sentence))
|
|
#return "42"
|
|
|
|
server = get_server(IP,PORT,answer)
|
|
|
|
logging.info('Running server on '+IP+':'+str(PORT))
|
|
server.serve_forever()
|
|
|