mirror of
https://github.com/home-assistant/core.git
synced 2025-08-01 03:35:09 +02:00
Media Player - MPD: handle more exceptions (#2045)
This commit is contained in:
committed by
Paulus Schoutsen
parent
f9d97c4356
commit
c341ae0a39
@@ -89,7 +89,13 @@ class MpdDevice(MediaPlayerDevice):
|
||||
try:
|
||||
self.status = self.client.status()
|
||||
self.currentsong = self.client.currentsong()
|
||||
except mpd.ConnectionError:
|
||||
except (mpd.ConnectionError, BrokenPipeError, ValueError):
|
||||
# Cleanly disconnect in case connection is not in valid state
|
||||
try:
|
||||
self.client.disconnect()
|
||||
except mpd.ConnectionError:
|
||||
pass
|
||||
|
||||
self.client.connect(self.server, self.port)
|
||||
|
||||
if self.password is not None:
|
||||
|
Reference in New Issue
Block a user