diff --git a/mopidy/frontends/http/__init__.py b/mopidy/frontends/http/__init__.py index d5f8f1bc..64cb88f9 100644 --- a/mopidy/frontends/http/__init__.py +++ b/mopidy/frontends/http/__init__.py @@ -21,8 +21,7 @@ class Extension(ext.Extension): schema['hostname'] = config.Hostname() schema['port'] = config.Port() schema['static_dir'] = config.Path(optional=True) - schema['zeroconf_enabled'] = config.Boolean() - schema['zeroconf_name'] = config.String() + schema['zeroconf'] = config.String(optional=True) return schema def validate_environment(self): diff --git a/mopidy/frontends/http/actor.py b/mopidy/frontends/http/actor.py index 1cd0c5f4..3e46dc63 100644 --- a/mopidy/frontends/http/actor.py +++ b/mopidy/frontends/http/actor.py @@ -93,10 +93,9 @@ class HttpFrontend(pykka.ThreadingActor, CoreListener): cherrypy.engine.start() logger.info('HTTP server running at %s', cherrypy.server.base()) - if self.config_section['zeroconf_enabled']: - name = self.config_section['zeroconf_name'] + if self.config_section['zeroconf']: self.zeroconf_service = zeroconf.Zeroconf( - stype='_http._tcp', name=name, + stype='_http._tcp', name=self.config_section['zeroconf'], host=self.hostname, port=self.port) if self.zeroconf_service.publish(): diff --git a/mopidy/frontends/http/ext.conf b/mopidy/frontends/http/ext.conf index 891aeb5b..fc239230 100644 --- a/mopidy/frontends/http/ext.conf +++ b/mopidy/frontends/http/ext.conf @@ -3,8 +3,7 @@ enabled = true hostname = 127.0.0.1 port = 6680 static_dir = -zeroconf_enabled = true -zeroconf_name = Mopidy HTTP server on $hostname +zeroconf = Mopidy HTTP server on $hostname [loglevels] cherrypy = warning diff --git a/mopidy/frontends/mpd/__init__.py b/mopidy/frontends/mpd/__init__.py index 28f9c951..571d6455 100644 --- a/mopidy/frontends/mpd/__init__.py +++ b/mopidy/frontends/mpd/__init__.py @@ -23,8 +23,7 @@ class Extension(ext.Extension): schema['password'] = config.Secret(optional=True) schema['max_connections'] = config.Integer(minimum=1) schema['connection_timeout'] = config.Integer(minimum=1) - schema['zeroconf_enabled'] = config.Boolean() - schema['zeroconf_name'] = config.String() + schema['zeroconf'] = config.String(optional=True) return schema def validate_environment(self): diff --git a/mopidy/frontends/mpd/actor.py b/mopidy/frontends/mpd/actor.py index a40834b2..6e277078 100644 --- a/mopidy/frontends/mpd/actor.py +++ b/mopidy/frontends/mpd/actor.py @@ -41,10 +41,9 @@ class MpdFrontend(pykka.ThreadingActor, CoreListener): logger.info('MPD server running at [%s]:%s', hostname, port) def on_start(self): - if self.config_section['zeroconf_enabled']: - name = self.config_section['zeroconf_name'] + if self.config_section['zeroconf']: self.zeroconf_service = zeroconf.Zeroconf( - stype="_mpd._tcp", name=name, + stype="_mpd._tcp", name=self.config_section['zeroconf'], port=self.port, host=self.hostname) if self.zeroconf_service.publish(): diff --git a/mopidy/frontends/mpd/ext.conf b/mopidy/frontends/mpd/ext.conf index ad3b333a..c62c37ef 100644 --- a/mopidy/frontends/mpd/ext.conf +++ b/mopidy/frontends/mpd/ext.conf @@ -5,5 +5,4 @@ port = 6600 password = max_connections = 20 connection_timeout = 60 -zeroconf_enabled = true -zeroconf_name = Mopidy MPD server on $hostname +zeroconf = Mopidy MPD server on $hostname