Protocols supporting volume controls can be controlled via the audio interface.
Using the Audio API
After connecting to a device, you get the apps interface via interface.AppleTV.audio:
atv = await pyatv.connect(config, ...) audio = atv.audio
To get current volume level, use interface.Audio.volume:
To change current volume, use interface.Audio.set_volume:
The volume level is normalized in the interval 0.0-100.0, where 0.0 means the audio is muted.
You can also step volume up or down using step level provided from the device (if available):
await audio.volume_up() await audio.volume_down()
The audio API supports push updates via a listener, as described here.