__init__.py 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. from __future__ import unicode_literals
  2. import logging
  3. import os
  4. from mopidy import config, ext
  5. from .touch_screen import TouchScreen
  6. __version__ = '0.2.2'
  7. # TODO: If you need to log, use loggers named after the current Python module
  8. logger = logging.getLogger(__name__)
  9. class Extension(ext.Extension):
  10. dist_name = 'Mopidy-Touchscreen'
  11. ext_name = 'touchscreen'
  12. version = __version__
  13. def get_default_config(self):
  14. conf_file = os.path.join(os.path.dirname(__file__),
  15. 'ext.conf')
  16. return config.read(conf_file)
  17. def get_config_schema(self):
  18. schema = super(Extension, self).get_config_schema()
  19. schema['screen_width'] = config.Integer(minimum=1)
  20. schema['screen_height'] = config.Integer(minimum=1)
  21. schema['cursor'] = config.Boolean()
  22. schema['fullscreen'] = config.Boolean()
  23. schema['cache_dir'] = config.Path()
  24. schema['gpio'] = config.Boolean()
  25. schema['gpio_left'] = config.Integer()
  26. schema['gpio_right'] = config.Integer()
  27. schema['gpio_up'] = config.Integer()
  28. schema['gpio_down'] = config.Integer()
  29. schema['gpio_enter'] = config.Integer()
  30. schema['sdl_fbdev'] = config.String()
  31. schema['sdl_mousdrv'] = config.String()
  32. schema['sdl_mousedev'] = config.String()
  33. schema['sdl_audiodriver'] = config.String()
  34. schema['sdl_path_dsp'] = config.String()
  35. return schema
  36. def setup(self, registry):
  37. registry.add('frontend', TouchScreen)