__init__.py 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. from .touch_screen_backend import TouchScreenBackend
  7. __version__ = '0.1.0'
  8. # TODO: If you need to log, use loggers named after the current Python module
  9. logger = logging.getLogger(__name__)
  10. class Extension(ext.Extension):
  11. dist_name = 'Mopidy-Touchscreen'
  12. ext_name = 'touchscreen'
  13. version = __version__
  14. def get_default_config(self):
  15. conf_file = os.path.join(os.path.dirname(__file__), '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()
  20. schema['screen_height'] = config.Integer()
  21. schema['cursor'] = config.Boolean()
  22. # TODO: Comment in and edit, or remove entirely
  23. #schema['username'] = config.String()
  24. #schema['password'] = config.Secret()
  25. return schema
  26. def setup(self, registry):
  27. registry.add('frontend', TouchScreen)
  28. registry.add('backend', TouchScreenBackend)