Skip to content

Commit

Permalink
Add active group attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelveldt committed Jun 13, 2024
1 parent 3894425 commit 0a7aa15
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions custom_components/mass/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
ATTR_GROUP_MEMBERS = "group_members"
ATTR_GROUP_PARENTS = "group_parents"
ATTR_ACTIVE_QUEUE = "active_queue"
ATTR_ACTIVE_GROUP = "active_group"
ATTR_QUEUE_ITEMS = "items_in_queue"
ATTR_QUEUE_INDEX = "queue_index"
ATTR_GROUP_LEADER = "group_leader"
Expand Down
2 changes: 2 additions & 0 deletions custom_components/mass/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
from music_assistant.common.models.media_items import MediaItemType

from .const import (
ATTR_ACTIVE_GROUP,
ATTR_ACTIVE_QUEUE,
ATTR_GROUP_LEADER,
ATTR_GROUP_MEMBERS,
Expand Down Expand Up @@ -234,6 +235,7 @@ def extra_state_attributes(self) -> Mapping[str, Any]:
ATTR_GROUP_MEMBERS: player.group_childs,
ATTR_GROUP_LEADER: player.synced_to,
ATTR_ACTIVE_QUEUE: player.active_source,
ATTR_ACTIVE_GROUP: player.active_group,
ATTR_QUEUE_ITEMS: queue.items if queue else None,
ATTR_QUEUE_INDEX: queue.current_index if queue else None,
}
Expand Down

0 comments on commit 0a7aa15

Please sign in to comment.