mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
parent
ecc249aa27
commit
7ac1e469b7
@ -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…
x
Reference in New Issue
Block a user