Trying to playpause a track

#83 · closed · 2 comments

View on GitHub ↗

jason-a69

Hi there, This is a really simple request, how do I send a request to playpause a track? The track is currently paused. I have managed to authorise my app. get the token and the correct zone, in this case "Qutest" I have tried `roonapi.play_media("Qutest", ["play", "playpause"])` But it does not work. Any clues please? Thanks very much.

Comments

pavoni

To do this you need to use the `playback_control` method ` - https://github.com/pavoni/pyroon/blob/981a62b715c0bd31664342a7cff94a8624e18f79/roonapi/roonapi.py#L197 You can see an example here: https://github.com/home-assistant/core/blob/1a1c95af12ea51ac94396b84e95c43d3ef62ee58/homeassistant/components/roon/media_player.py#L352

jason-a69

> To do this you need to use the `playback_control` method ` - > > [pyroon/roonapi/roonapi.py](https://github.com/pavoni/pyroon/blob/981a62b715c0bd31664342a7cff94a8624e18f79/roonapi/roonapi.py#L197) > > Line 197 in [981a62b](/pavoni/pyroon/commit/981a62b715c0bd31664342a7cff94a8624e18f79) > > def playback_control(self, zone_or_output_id, control="play"): > You can see an example here: https://github.com/home-assistant/core/blob/1a1c95af12ea51ac94396b84e95c43d3ef62ee58/homeassistant/components/roon/media_player.py#L352 Thanks very much, perfect!