Don't throw the exception if a certain Snapcast host is not reachable

This commit is contained in:
Fabio Manganiello 2019-01-11 11:50:37 +01:00
parent 29be2945cc
commit 33fd226fa1

View file

@ -569,6 +569,7 @@ class MusicSnapcastPlugin(Plugin):
playing_hosts = {} playing_hosts = {}
def _worker(host, port): def _worker(host, port):
try:
if exclude_local and (host == 'localhost' if exclude_local and (host == 'localhost'
or host == Config.get('device_id')): or host == Config.get('device_id')):
return return
@ -593,6 +594,10 @@ class MusicSnapcastPlugin(Plugin):
return return
playing_hosts[host] = port playing_hosts[host] = port
except Exception as e:
self.logger.warning(('Error while retrieving the status of ' +
'Snapcast host at {}:{}: {}').format(
host, port, str(e)))
workers = [] workers = []