sonos: Fix nil index error in get_groups response #2405
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check all that apply
Type of Change
Checklist
Description of Change
There are some errors popping up after the latest sonos driver release to beta due to the players in the groups response not containing the field
devices
. Fortunately, all we care about are the IDs of these devices and the players should also have a fielddeviceIds
.The sonos docs are not very clear because both
deviceIds
anddevices
are shown as deprecated. However,deviceIds
and other fields reference that you should be using thedevices
array. There is also a query parameter that you can use to include the device info but that doesn't appear to do anything from my testing.https://docs.sonos.com/reference/groups-getgroups-householdid
Summary of Completed Tests
Testing on my two play:3 and Sonos One all on the latest firmware, both fields
deviceIds
anddevices
are available. I have tested that using either field will work for tracking the bonded set. I have not been able to reproduce where thedevices
is missing. It looks like this will happen if the sonos device is on an older firmware.