main.py 887 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import cec
  2. from engine.config import settings
  3. from engine import log
  4. from engine.plugins import importer
  5. from tv.cec import control, events
  6. from tv.screen import display as screen
  7. PROFILES = ['red', 'green', 'yellow', 'blue']
  8. SETTINGS = settings.SettingsConfig()
  9. def main():
  10. log.info('Starting')
  11. log.debug('Name: {}'.format(SETTINGS.get('DeviceName')))
  12. log.info('Load plugins')
  13. importer.find_plugins()
  14. importer.load_plugins(SETTINGS.get('Plugins'))
  15. for plugin in importer.ENABLED_PLUGINS:
  16. importer.ENABLED_PLUGINS[plugin].get_class()().start()
  17. if SETTINGS.get('CEC'):
  18. control.TVControl()
  19. def event_start():
  20. log.debug('Callback event called!')
  21. ev = events.Callback(event_start)
  22. events.register_event(callback=ev, event=cec.EVENT_ALL)
  23. screen.Display()
  24. if __name__ == '__main__':
  25. main()