public class GroupVolumeResource extends Object implements Subscribable
| Constructor and Description |
|---|
GroupVolumeResource(SonosApiClient apiClient)
Constructor for GroupVolumeResource.
|
| Modifier and Type | Method and Description |
|---|---|
SonosGroupVolume |
getVolume(String clientToken,
String groupId)
Get the volume properties for the specified group
|
SonosSuccess |
setMute(String clientToken,
String groupId,
Boolean isMuted)
Set the mute status of a group (not a toggle)
|
SonosSuccess |
setRelativeVolume(String clientToken,
String groupId,
Integer volumeDelta)
Adjust the volume of a group by the specified amount
|
SonosSuccess |
setVolume(String clientToken,
String groupId,
Integer volume)
Set a specific volume for a group
Sonos docs
|
SonosSuccess |
subscribe(String clientToken,
String groupId)
Subscribe to events for this resource.
|
SonosSuccess |
unsubscribe(String clientToken,
String groupId)
Unsubscribe from events related to this resource.
|
public GroupVolumeResource(SonosApiClient apiClient)
Constructor for GroupVolumeResource.
apiClient - a SonosApiClient object.public SonosGroupVolume getVolume(String clientToken, String groupId) throws SonosApiClientException, SonosApiError
clientToken - for the usergroupId - to fetch the volume properties forSonosGroupVolume for the specified SonosGroupSonosApiClientException - if an error occurs during the callSonosApiError - if there is an error from the APIpublic SonosSuccess setVolume(String clientToken, String groupId, Integer volume) throws SonosApiClientException, SonosApiError
clientToken - for the usergroupId - to modify the volume ofvolume - to set the group toSonosApiClientException - if an error occurs during the callSonosApiError - if there is an error from the APIpublic SonosSuccess setRelativeVolume(String clientToken, String groupId, Integer volumeDelta) throws SonosApiClientException, SonosApiError
clientToken - for the usergroupId - to set the volume forvolumeDelta - to adjust the volume bySonosApiClientException - if an error occurs during the callSonosApiError - if there is an error from the APIpublic SonosSuccess setMute(String clientToken, String groupId, Boolean isMuted) throws SonosApiClientException, SonosApiError
clientToken - for the usergroupId - of the group to mute/unmuteisMuted - whether the group should be muted/unmutedSonosApiClientException - if an error occurs during the callSonosApiError - if there is an error from the APIpublic SonosSuccess subscribe(String clientToken, String groupId) throws SonosApiClientException, SonosApiError
Subscribe to events for this resource.
Subscribe to volume events for a groupsubscribe in interface SubscribableclientToken - for the usergroupId - of the resource to subscribe toSonosApiClientException - if an error occurs during the callSonosApiError - if there is an error from the APIpublic SonosSuccess unsubscribe(String clientToken, String groupId) throws SonosApiClientException, SonosApiError
Unsubscribe from events related to this resource.
Unsubscribe from volume events for a groupunsubscribe in interface SubscribableclientToken - for the usergroupId - of the resource to unsubscribe fromSonosApiClientException - if an error occurs during the callSonosApiError - if there is an error from the APICopyright © 2018. All rights reserved.