+ def noidle(self):
+ # noidle's special case
+ if not self._pending or self._pending[0] != 'idle':
+ raise CommandError('cannot send noidle if send_idle was not called')
+ del self._pending[0]
+ self._write_command("noidle")
+ return self._fetch_list()
+
+ def connect(self, host=None, port=None):
+ """Connects the MPD server
+
+ :param str host: hostname, IP or FQDN (defaults to `localhost` or socket, see below for details)
+ :param str port: port number (defaults to 6600)
+
+ The connect method honors MPD_HOST/MPD_PORT environment variables.
+
+ .. note:: Default host/port
+
+ If host evaluate to :py:obj:`False`
+ * use ``MPD_HOST`` env. var. if set, extract password if present,
+ * else looks for a existing file in ``${XDG_RUNTIME_DIR:-/run/}/mpd/socket``
+ * else set host to ``localhost``
+
+ If port evaluate to :py:obj:`False`
+ * if ``MPD_PORT`` env. var. is set, use it for port
+ * else use ``6600``
+ """
+ if not host:
+ host = self.host
+ if not port:
+ port = self.port