setVolume method
Sets the playback volume to volumePercent, which must be between 0 and 100.
Implementation
Future<void> setVolume(int volumePercent, {String? deviceId}) async {
assert(volumePercent >= 0 && volumePercent <= 100,
'volumePercent must be between 0 and 100');
final uri = Uri.https(
_baseApiHost,
'/v1/me/player/volume',
{
'volume_percent': volumePercent.toString(),
if (deviceId != null) 'device_id': deviceId,
},
);
await _putJson(uri);
}