mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Use standard attribute for Sonos group members (#70924)
This commit is contained in:
parent
b17d27262c
commit
6151306e3d
@ -76,8 +76,6 @@ REPEAT_TO_SONOS = {
|
||||
|
||||
SONOS_TO_REPEAT = {meaning: mode for mode, meaning in REPEAT_TO_SONOS.items()}
|
||||
|
||||
ATTR_SONOS_GROUP = "sonos_group"
|
||||
|
||||
UPNP_ERRORS_TO_IGNORE = ["701", "711", "712"]
|
||||
|
||||
SERVICE_JOIN = "join"
|
||||
@ -265,6 +263,11 @@ class SonosMediaPlayerEntity(SonosEntity, MediaPlayerEntity):
|
||||
"""Return the current coordinator SonosSpeaker."""
|
||||
return self.speaker.coordinator or self.speaker
|
||||
|
||||
@property
|
||||
def group_members(self) -> list[str] | None:
|
||||
"""List of entity_ids which are currently grouped together."""
|
||||
return self.speaker.sonos_group_entities
|
||||
|
||||
def __hash__(self) -> int:
|
||||
"""Return a hash of self."""
|
||||
return hash(self.unique_id)
|
||||
@ -654,9 +657,7 @@ class SonosMediaPlayerEntity(SonosEntity, MediaPlayerEntity):
|
||||
@property
|
||||
def extra_state_attributes(self) -> dict[str, Any]:
|
||||
"""Return entity specific state attributes."""
|
||||
attributes: dict[str, Any] = {
|
||||
ATTR_SONOS_GROUP: self.speaker.sonos_group_entities
|
||||
}
|
||||
attributes: dict[str, Any] = {}
|
||||
|
||||
if self.media.queue_position is not None:
|
||||
attributes[ATTR_QUEUE_POSITION] = self.media.queue_position
|
||||
|
Loading…
x
Reference in New Issue
Block a user