parent
ecc249aa27
commit
7ac1e469b7
1 changed files with 3 additions and 2 deletions
|
@ -79,14 +79,15 @@ class MpdDevice(MediaPlayerDevice):
|
||||||
self._client = mpd.MPDClient()
|
self._client = mpd.MPDClient()
|
||||||
self._client.timeout = 5
|
self._client.timeout = 5
|
||||||
self._client.idletimeout = None
|
self._client.idletimeout = None
|
||||||
if password is not None:
|
|
||||||
self._client.password(password)
|
|
||||||
|
|
||||||
def _connect(self):
|
def _connect(self):
|
||||||
"""Connect to MPD."""
|
"""Connect to MPD."""
|
||||||
import mpd
|
import mpd
|
||||||
try:
|
try:
|
||||||
self._client.connect(self.server, self.port)
|
self._client.connect(self.server, self.port)
|
||||||
|
|
||||||
|
if self.password is not None:
|
||||||
|
self._client.password(self.password)
|
||||||
except mpd.ConnectionError:
|
except mpd.ConnectionError:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue