Adjust Sonos visibility checks (#67196)
This commit is contained in:
parent
199d359814
commit
a4ba71408b
1 changed files with 5 additions and 4 deletions
|
@ -182,6 +182,9 @@ class SonosDiscoveryManager:
|
|||
soco = SoCo(ip_address)
|
||||
# Ensure that the player is available and UID is cached
|
||||
uid = soco.uid
|
||||
# Abort early if the device is not visible
|
||||
if not soco.is_visible:
|
||||
return None
|
||||
_ = soco.volume
|
||||
return soco
|
||||
except NotSupportedException as exc:
|
||||
|
@ -240,8 +243,7 @@ class SonosDiscoveryManager:
|
|||
None,
|
||||
)
|
||||
if not known_uid:
|
||||
soco = self._create_soco(ip_addr, SoCoCreationSource.CONFIGURED)
|
||||
if soco and soco.is_visible:
|
||||
if soco := self._create_soco(ip_addr, SoCoCreationSource.CONFIGURED):
|
||||
self._discovered_player(soco)
|
||||
|
||||
self.data.hosts_heartbeat = call_later(
|
||||
|
@ -249,8 +251,7 @@ class SonosDiscoveryManager:
|
|||
)
|
||||
|
||||
def _discovered_ip(self, ip_address):
|
||||
soco = self._create_soco(ip_address, SoCoCreationSource.DISCOVERED)
|
||||
if soco and soco.is_visible:
|
||||
if soco := self._create_soco(ip_address, SoCoCreationSource.DISCOVERED):
|
||||
self._discovered_player(soco)
|
||||
|
||||
async def _async_create_discovered_player(self, uid, discovered_ip, boot_seqnum):
|
||||
|
|
Loading…
Add table
Reference in a new issue