mopidy-subidy/mopidy_subidy/__init__.py

31 lines
810 B
Python
Raw Normal View History

2016-09-18 04:33:46 +02:00
import os
2020-03-08 12:31:00 +01:00
from mopidy import config, ext
2016-09-18 04:33:46 +02:00
2020-03-08 12:30:34 +01:00
__version__ = "0.2.1"
2016-09-18 04:33:46 +02:00
class SubidyExtension(ext.Extension):
2020-03-08 12:30:34 +01:00
dist_name = "Mopidy-Subidy"
ext_name = "subidy"
2016-09-18 04:33:46 +02:00
version = __version__
def get_default_config(self):
2020-03-08 12:30:34 +01:00
conf_file = os.path.join(os.path.dirname(__file__), "ext.conf")
2016-09-18 04:33:46 +02:00
return config.read(conf_file)
def get_config_schema(self):
2020-03-08 12:30:14 +01:00
schema = super().get_config_schema()
2020-03-08 12:30:34 +01:00
schema["url"] = config.String()
schema["username"] = config.String()
schema["password"] = config.Secret()
schema["legacy_auth"] = config.Boolean(optional=True)
schema["api_version"] = config.String(optional=True)
2016-09-18 04:33:46 +02:00
return schema
def setup(self, registry):
from .backend import SubidyBackend
2020-03-08 12:30:34 +01:00
registry.add("backend", SubidyBackend)