Log source of discovery in Sonos (#53101)
This commit is contained in:
parent
4fceac00b1
commit
0277a645f1
2 changed files with 6 additions and 4 deletions
|
@ -261,11 +261,13 @@ class SonosDiscoveryManager:
|
||||||
if uid.startswith("uuid:"):
|
if uid.startswith("uuid:"):
|
||||||
uid = uid[5:]
|
uid = uid[5:]
|
||||||
self.async_discovered_player(
|
self.async_discovered_player(
|
||||||
info, discovered_ip, uid, boot_seqnum, info.get("modelName")
|
"SSDP", info, discovered_ip, uid, boot_seqnum, info.get("modelName")
|
||||||
)
|
)
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def async_discovered_player(self, info, discovered_ip, uid, boot_seqnum, model):
|
def async_discovered_player(
|
||||||
|
self, source, info, discovered_ip, uid, boot_seqnum, model
|
||||||
|
):
|
||||||
"""Handle discovery via ssdp or zeroconf."""
|
"""Handle discovery via ssdp or zeroconf."""
|
||||||
if model in DISCOVERY_IGNORED_MODELS:
|
if model in DISCOVERY_IGNORED_MODELS:
|
||||||
_LOGGER.debug("Ignoring device: %s", info)
|
_LOGGER.debug("Ignoring device: %s", info)
|
||||||
|
@ -274,7 +276,7 @@ class SonosDiscoveryManager:
|
||||||
boot_seqnum = int(boot_seqnum)
|
boot_seqnum = int(boot_seqnum)
|
||||||
self.data.boot_counts.setdefault(uid, boot_seqnum)
|
self.data.boot_counts.setdefault(uid, boot_seqnum)
|
||||||
if uid not in self.data.discovery_known:
|
if uid not in self.data.discovery_known:
|
||||||
_LOGGER.debug("New discovery uid=%s: %s", uid, info)
|
_LOGGER.debug("New %s discovery uid=%s: %s", source, uid, info)
|
||||||
self.data.discovery_known.add(uid)
|
self.data.discovery_known.add(uid)
|
||||||
asyncio.create_task(
|
asyncio.create_task(
|
||||||
self._async_create_discovered_player(uid, discovered_ip, boot_seqnum)
|
self._async_create_discovered_player(uid, discovered_ip, boot_seqnum)
|
||||||
|
|
|
@ -50,7 +50,7 @@ class SonosDiscoveryFlowHandler(DiscoveryFlowHandler):
|
||||||
)
|
)
|
||||||
if discovery_manager := self.hass.data.get(DATA_SONOS_DISCOVERY_MANAGER):
|
if discovery_manager := self.hass.data.get(DATA_SONOS_DISCOVERY_MANAGER):
|
||||||
discovery_manager.async_discovered_player(
|
discovery_manager.async_discovered_player(
|
||||||
properties, host, uid, boot_seqnum, model
|
"Zeroconf", properties, host, uid, boot_seqnum, model
|
||||||
)
|
)
|
||||||
return await self.async_step_discovery(discovery_info)
|
return await self.async_step_discovery(discovery_info)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue