SoCo: Group broken by Sonos version 10.1
I updated my Sonos to version 10.1 today and noticed that some of my scripts that rely on SoCo seem to have broken.
Seems to be a problem with groups. When trying to find coordinator of a group with
device.group.coordinator.player_name
I get error:
Traceback (most recent call last): File "./test", line 7, in <module> print(device.group.coordinator.player_name) AttributeError: 'NoneType' object has no attribute 'coordinator'
and print(device.group) just gives output of:
None
I’m assuming this is the 10.1 upgrade. Does anybody else see this, and know if it is fixable?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 46 (14 by maintainers)
Commits related to this issue
- fix for new sonos version 10.1, see https://github.com/SoCo/SoCo/issues/660 — committed to smarthomeNG/plugins by deleted user 5 years ago
- Implemented SpeakerSonos Not fully functional yet due to https://github.com/SoCo/SoCo/issues/660 — committed to mrusme/melon by mrusme 5 years ago
- add workaround for https://github.com/SoCo/SoCo/issues/660 — committed to StefanSchoof/KassetteV2 by deleted user 5 years ago
- Fix for Issue 660 - Properly parse discover Properly parse discover return messages. Addresses https://github.com/SoCo/SoCo/issues/660 — committed to EliSchleifer/SoCo by EliSchleifer 5 years ago
I found a fix that work in my small network sonos system.
I’m not sure if the
ZoneGroupsis not multiple.Same here.
soco.discover()returns the empty set.It looks like the information is still there. Doing a tcpdump whilst running soco.discover() on my 4 speaker system shows this:
I’m guessing the format has changed? Unfortunately my python coding is very poor so looking at the code is not helping me figure this out.
I had to install pip in the normal python terminal and after that i could install soco. Now i can run the python file. (: It will alsow run on my computer startup now. Thank you soo much for the Help!
I merged the fix as applied in #662. I will see about doing a release fast.
@jnth - great, your fix works for me - thanks
@DrKeks - yes, this is part of the soco files. Find where your installation is. Mine is in /usr/lib/python3.6/site-packages/soco, but yours might vary depending on python version and general set-up. You are specifically looking for a file called core.py. Copy the patch code from @jnth’s post above and paste it in a file called patch.txt in the directory you’ve just found. Then run:
patch < patch.txt