Ignore Sonos players with unknown hostnames (#11013)

This commit is contained in:
Anders Melchiorsen authored and Pascal Vizeli committed 2017-12-08 12:01:10 +01:00
1 parent f892c3394b
commit 0a7e6ac222
1 file changed
+4 -1
@@ -140,7 +140,10 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
hosts = hosts.split(',') if isinstance(hosts, str) else hosts
players = []
for host in hosts:
players.append(soco.SoCo(socket.gethostbyname(host)))
try:
players.append(soco.SoCo(socket.gethostbyname(host)))
except OSError:
_LOGGER.warning("Failed to initialize '%s'", host)
if not players:
players = soco.discover(