This commit is contained in:
1 parent
0560079b16
commit
db00e57ef7
9 files changed
+328
-228
No files matched your search
@@ -422,12 +422,22 @@ def api_mute():
|
||||
@handle_errors
|
||||
def api_playback():
|
||||
"""Start or stop a room. Send 'state' to be explicit, or leave it out to
|
||||
flip whatever the speakers are actually doing."""
|
||||
flip whatever the speakers are actually doing.
|
||||
|
||||
For the AVR this goes around HEOS to the Zidoo, the same way /api/seek
|
||||
does and for the same reason: what the AVR's card shows playing is a
|
||||
device on one of its inputs, which HEOS can no more pause than seek in.
|
||||
The Zidoo has no 'stop', only play and pause."""
|
||||
data = _payload()
|
||||
key = _target_from(data)
|
||||
state = data.get("state")
|
||||
if state is not None and state not in ("play", "pause", "stop"):
|
||||
raise ValueError("'state' must be play, pause or stop -- or left out to toggle")
|
||||
if key == config.HOST_KEY:
|
||||
if state == "stop":
|
||||
raise ValueError("The AVR's card plays a device on one of its inputs, which can only "
|
||||
"play or pause -- 'stop' is for a HEOS room")
|
||||
return jsonify({"target": key, "state": controller.zidoo_play_state(state)})
|
||||
return jsonify({"target": key, "state": controller.toggle_play(key, state)})
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user