28 lines
672 B
Python
Executable File
28 lines
672 B
Python
Executable File
#!/usr/bin/env python
|
|
"Background Daemon"
|
|
import time
|
|
import logging
|
|
|
|
from mycroft_bus_client import MessageBusClient
|
|
|
|
import config
|
|
from daemon import Daemon
|
|
from plugins import plugins
|
|
|
|
def main():
|
|
"Main function"
|
|
logging.basicConfig(level=logging.DEBUG)
|
|
mycroft = MessageBusClient()
|
|
daemon = Daemon(config.OSD_URL, config.CAR_API_URL, mycroft)
|
|
for plugin in plugins:
|
|
daemon.register_plugin(plugin)
|
|
# Start mycroft after registering plugins so that an .on events by plugins
|
|
# get registered
|
|
mycroft.run_in_thread()
|
|
while True:
|
|
daemon.check_all()
|
|
time.sleep(config.DELAY)
|
|
|
|
if __name__ == "__main__":
|
|
main()
|