__init__.py 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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.3.2'
  7. class Extension(ext.Extension):
  8. dist_name = 'Mopidy-Touchscreen'
  9. ext_name = 'touchscreen'
  10. version = __version__
  11. def get_default_config(self):
  12. conf_file = os.path.join(os.path.dirname(__file__),
  13. 'ext.conf')
  14. return config.read(conf_file)
  15. def get_config_schema(self):
  16. schema = super(Extension, self).get_config_schema()
  17. schema['screen_width'] = config.Integer(minimum=1)
  18. schema['screen_height'] = config.Integer(minimum=1)
  19. schema['cursor'] = config.Boolean()
  20. schema['fullscreen'] = config.Boolean()
  21. schema['cache_dir'] = config.Path()
  22. schema['gpio'] = config.Boolean()
  23. schema['gpio_left'] = config.Integer()
  24. schema['gpio_right'] = config.Integer()
  25. schema['gpio_up'] = config.Integer()
  26. schema['gpio_down'] = config.Integer()
  27. schema['gpio_enter'] = config.Integer()
  28. schema['sdl_fbdev'] = config.String()
  29. schema['sdl_mousdrv'] = config.String()
  30. schema['sdl_mousedev'] = config.String()
  31. schema['sdl_audiodriver'] = config.String()
  32. schema['sdl_path_dsp'] = config.String()
  33. return schema
  34. def setup(self, registry):
  35. registry.add('frontend', TouchScreen)