Make sonos ssdp discovery callback a callback function (#113107)

This commit is contained in:
J. Nick Koston 2024-03-11 13:50:04 -10:00 committed by GitHub
parent 487ae1786f
commit 6ff8d7d2b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View file

@ -493,7 +493,8 @@ class SonosDiscoveryManager:
self.hass, f"{SONOS_SPEAKER_ACTIVITY}-{uid}", source
)
async def _async_ssdp_discovered_player(
@callback
def _async_ssdp_discovered_player(
self, info: ssdp.SsdpServiceInfo, change: ssdp.SsdpChange
) -> None:
uid = info.upnp[ssdp.ATTR_UPNP_UDN]

View file

@ -240,8 +240,8 @@ async def silent_ssdp_scanner(hass):
def discover_fixture(soco):
"""Create a mock soco discover fixture."""
async def do_callback(hass, callback, *args, **kwargs):
await callback(
def do_callback(hass, callback, *args, **kwargs):
callback(
ssdp.SsdpServiceInfo(
ssdp_location=f"http://{soco.ip_address}/",
ssdp_st="urn:schemas-upnp-org:device:ZonePlayer:1",