mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 22:37:11 +00:00
Log source of discovery in Sonos (#53101)
This commit is contained in:
parent
4fceac00b1
commit
0277a645f1
@ -261,11 +261,13 @@ class SonosDiscoveryManager:
|
||||
if uid.startswith("uuid:"):
|
||||
uid = uid[5:]
|
||||
self.async_discovered_player(
|
||||
info, discovered_ip, uid, boot_seqnum, info.get("modelName")
|
||||
"SSDP", info, discovered_ip, uid, boot_seqnum, info.get("modelName")
|
||||
)
|
||||
|
||||
@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."""
|
||||
if model in DISCOVERY_IGNORED_MODELS:
|
||||
_LOGGER.debug("Ignoring device: %s", info)
|
||||
@ -274,7 +276,7 @@ class SonosDiscoveryManager:
|
||||
boot_seqnum = int(boot_seqnum)
|
||||
self.data.boot_counts.setdefault(uid, boot_seqnum)
|
||||
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)
|
||||
asyncio.create_task(
|
||||
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):
|
||||
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)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user