mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Merge pull request #1319 from shaftoe/sonosconfig
Fix media_player/sonos configuration mismatch
This commit is contained in:
commit
e677fc876b
@ -47,10 +47,12 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||||||
players = None
|
players = None
|
||||||
hosts = config.get('hosts', None)
|
hosts = config.get('hosts', None)
|
||||||
if hosts:
|
if hosts:
|
||||||
|
# Support retro compatibility with comma separated list of hosts
|
||||||
|
# from config
|
||||||
|
hosts = hosts.split(',') if isinstance(hosts, str) else hosts
|
||||||
players = []
|
players = []
|
||||||
for host in hosts.split(","):
|
for host in hosts:
|
||||||
host = socket.gethostbyname(host)
|
players.append(soco.SoCo(socket.gethostbyname(host)))
|
||||||
players.append(soco.SoCo(host))
|
|
||||||
|
|
||||||
if not players:
|
if not players:
|
||||||
players = soco.discover(interface_addr=config.get('interface_addr',
|
players = soco.discover(interface_addr=config.get('interface_addr',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user