play/pause
Deploy HEOS panel / deploy (push) Successful in 24s

This commit is contained in:
2026-09-15 01:03:25 +02:00
parent d2d7677519
commit dc7f09052d
9 changed files with 160 additions and 8 deletions
+13
View File
@@ -136,6 +136,19 @@ def api_mute():
return jsonify({"target": key, "ok": True})
@app.post("/api/playback")
@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."""
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")
return jsonify({"target": key, "state": controller.toggle_play(key, state)})
@app.post("/api/group")
@handle_errors
def api_group():