Skip to content

Request: Add GroupId to SonosDevice #182

@orensharon

Description

@orensharon

I would like to get the GroupId of each SonosDevice similary to the GroupName getter.
For example:

manager.Devices.forEach(d => {
  console.log('Device %s (%s) is joined in %s', d.Name, d.Uuid, d.GroupId)
  ....

Another solution that would work, is to add the groupId to the related group events data.

This would be helpful when dealing with Group Events:

const onGroupRenderingChanged = async (data) => {
    const sonosDevice = manager.Devices.find(data.coordinatorId)
    const timestamp = Date.now()
    const deviceGroupId = sonosDevice.GroupId
    const eventGroupId = data.GroupId
    //const groupId = await sonosDevice.ZoneGroupTopologyService.GetZoneGroupAttributes()
    //        .then(attributes => attributes.CurrentZoneGroupID)
    const event = { groupId, data, timestamp }
    events.emit('group-rendering', event)
}

.....
const id = sonosDevice.uuid
sonosDevice.GroupRenderingControlService.Events.on(ServiceEvent, data => onGroupRenderingChanged({ id, data })
....
....

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions