Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial support for controlling device groups #34

Merged
merged 4 commits into from
Feb 9, 2019
Merged

Conversation

rytilahti
Copy link
Owner

@rytilahti rytilahti commented Dec 8, 2018

This PR implements most of the speaker grouping commands.
Most of these are completely untested as I have only a single device, so feedback is appreciated!
Fixes #12 and #32.

songpal group --url http://xxxxx:52323/dmr.xml --help
Usage: songpal group [OPTIONS] COMMAND [ARGS]...

Options:
  --url TEXT  [required]
  --help      Show this message and exit.

Commands:
  abort   Abort existing group.
  add     Add speakers to group.
  codec   Codec settings.
  create  Create new group
  info    Control information.
  memory  Group memory.
  mute    (Un)mute group.
  play    Play?
  remove  Remove speakers from group.
  state   Current group state.
  stop    Stop playing?
  volume  Adjust volume [-100, 100].

Use songpal discover to find the URL and the uuids required for group creation:

Found HT-XT3 - BAR-2015
* API version: 1.0
* Endpoint: http://xxxx:10000/sony
* UDN: uuid:00000000-0000-1010-8000-xxxxx
* UPnP URL: http://xxxx:52323/dmr.xml
* Services:
  - Service: guide
  - Service: system
  - Service: audio
  - Service: avContent

The "UPnP URL" needs to be passed to group command with --url. The uuids printed out with UDN are required for pairing the slave devices.

To test:

songpal group --url http://xxx/dmr.xml state

should return the current state.

To form a group:

songpal group --url <upnp url> create <name of the group> <list of uuids..>

E.g.

songpal group --url http://xxx/dmr.xml create 'test group' uuid:00000000-0000-1010-8000-xx uuid:00000000-0000-1010-8000-yy uuid:00000000-0000-1010-8000-zz

would create a group 'test group' and adding those three devices to it. The URL is the UPnP URL of the master device.

To 'abort' a group:

songpal group abort

The following commands are not yet exposed and/or implemented:

        INFO:songpal.upnpctl:Action: <UpnpService.Action(X_GetStateM)> ([])
        INFO:songpal.upnpctl:Action: <UpnpService.Action(X_SetGroupName)> (['GroupName'])
        INFO:songpal.upnpctl:Action: <UpnpService.Action(X_DeleteGroupMemory)> (['MemoryID'])
        INFO:songpal.upnpctl:Action: <UpnpService.Action(X_UpdateGroupMemory)> (['MemoryID', 'GroupMode', 'GroupName', 'SlaveList', 'CodecType', 'CodecBitrate'])
        INFO:songpal.upnpctl:Action: <UpnpService.Action(X_EntryM)> (['MasterSessionID', 'SlaveList'])
        INFO:songpal.upnpctl:Action: <UpnpService.Action(X_LeaveM)> (['MasterSessionID', 'SlaveList'])
        INFO:songpal.upnpctl:Action: <UpnpService.Action(X_SetCodec)> (['CodecType', 'CodecBitrate'])
        INFO:songpal.upnpctl:Action: <UpnpService.Action(X_Invite)> (['GroupMode', 'GroupName', 'MasterUUID', 'MasterSessionID'])
        INFO:songpal.upnpctl:Action: <UpnpService.Action(X_Exit)> (['SlaveSessionID'])
        INFO:songpal.upnpctl:Action: <UpnpService.Action(X_Delegate)> (['GroupMode', 'SlaveList', 'DelegateURI', 'DelegateURIMetaData'])

@rytilahti rytilahti force-pushed the groupcontrol branch 2 times, most recently from a450b9a to 701314d Compare December 9, 2018 20:26
Currently only state, create and abort are implemented.
These are also completely untested as I have only a single device.
Fixes #12.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant