Only add visible sonos devices
Some Sonos devices (e.g SUB) does not have a upnp media renderer, but are discovered as sonos devices. Creating a SonosDevice object from such a device will fail.
This commit is contained in:
parent
b45c0cd735
commit
5931bac695
1 changed files with 5 additions and 2 deletions
|
@ -39,8 +39,11 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
import soco
|
||||
|
||||
if discovery_info:
|
||||
add_devices([SonosDevice(hass, soco.SoCo(discovery_info))])
|
||||
return True
|
||||
player = soco.SoCo(discovery_info)
|
||||
if player.is_visible:
|
||||
add_devices([SonosDevice(hass, player)])
|
||||
return True
|
||||
return False
|
||||
|
||||
players = None
|
||||
hosts = config.get('hosts', None)
|
||||
|
|
Loading…
Add table
Reference in a new issue