__init__.py 1.4 KB

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