mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
Ignore Sonos players with unknown hostnames (#11013)
This commit is contained in:
parent
f892c3394b
commit
0a7e6ac222
@ -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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user