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)
|
soco = SoCo(ip_address)
|
||||||
# Ensure that the player is available and UID is cached
|
# Ensure that the player is available and UID is cached
|
||||||
uid = soco.uid
|
uid = soco.uid
|
||||||
|
# Abort early if the device is not visible
|
||||||
|
if not soco.is_visible:
|
||||||
|
return None
|
||||||
_ = soco.volume
|
_ = soco.volume
|
||||||
return soco
|
return soco
|
||||||
except NotSupportedException as exc:
|
except NotSupportedException as exc:
|
||||||
|
@ -240,8 +243,7 @@ class SonosDiscoveryManager:
|
||||||
None,
|
None,
|
||||||
)
|
)
|
||||||
if not known_uid:
|
if not known_uid:
|
||||||
soco = self._create_soco(ip_addr, SoCoCreationSource.CONFIGURED)
|
if soco := self._create_soco(ip_addr, SoCoCreationSource.CONFIGURED):
|
||||||
if soco and soco.is_visible:
|
|
||||||
self._discovered_player(soco)
|
self._discovered_player(soco)
|
||||||
|
|
||||||
self.data.hosts_heartbeat = call_later(
|
self.data.hosts_heartbeat = call_later(
|
||||||
|
@ -249,8 +251,7 @@ class SonosDiscoveryManager:
|
||||||
)
|
)
|
||||||
|
|
||||||
def _discovered_ip(self, ip_address):
|
def _discovered_ip(self, ip_address):
|
||||||
soco = self._create_soco(ip_address, SoCoCreationSource.DISCOVERED)
|
if soco := self._create_soco(ip_address, SoCoCreationSource.DISCOVERED):
|
||||||
if soco and soco.is_visible:
|
|
||||||
self._discovered_player(soco)
|
self._discovered_player(soco)
|
||||||
|
|
||||||
async def _async_create_discovered_player(self, uid, discovered_ip, boot_seqnum):
|
async def _async_create_discovered_player(self, uid, discovered_ip, boot_seqnum):
|
||||||
|
|
Loading…
Add table
Reference in a new issue