Skip to content

Commit

Permalink
Fix Sonos importing deprecating constant (#136926)
Browse files Browse the repository at this point in the history
  • Loading branch information
joostlek authored Jan 30, 2025
1 parent 232e99b commit 773375e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions homeassistant/components/sonos/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@
)
from homeassistant.helpers.dispatcher import async_dispatcher_send
from homeassistant.helpers.event import async_call_later, async_track_time_interval
from homeassistant.helpers.service_info.ssdp import SsdpServiceInfo
from homeassistant.helpers.service_info.ssdp import (
ATTR_UPNP_MODEL_NAME,
ATTR_UPNP_UDN,
SsdpServiceInfo,
)
from homeassistant.helpers.typing import ConfigType
from homeassistant.util.async_ import create_eager_task

Expand Down Expand Up @@ -503,7 +507,7 @@ async def _async_handle_discovery_message(
def _async_ssdp_discovered_player(
self, info: SsdpServiceInfo, change: ssdp.SsdpChange
) -> None:
uid = info.upnp[ssdp.ATTR_UPNP_UDN]
uid = info.upnp[ATTR_UPNP_UDN]
if not uid.startswith("uuid:RINCON_"):
return
uid = uid[5:]
Expand All @@ -522,7 +526,7 @@ def _async_ssdp_discovered_player(
cast(str, urlparse(info.ssdp_location).hostname),
uid,
info.ssdp_headers.get("X-RINCON-BOOTSEQ"),
cast(str, info.upnp.get(ssdp.ATTR_UPNP_MODEL_NAME)),
cast(str, info.upnp.get(ATTR_UPNP_MODEL_NAME)),
None,
)

Expand Down

0 comments on commit 773375e

Please sign in to comment.