Add spotify queue
Deploy HEOS panel / deploy (push) Successful in 30s

This commit is contained in:
franzz committed 2026-10-20 15:44:56 +02:00
1 parent 6c76121863
commit 6bee9bd9a3
13 files changed
+230 -5

No files matched your search

+8 -1
View File
@@ -1,5 +1,5 @@
"""Stand-in Spotify Web API: just enough of /api/token, .../player/devices,
.../player, .../player/pause and .../player/seek to test spotify.py against, the same way
.../player, .../player/queue, .../player/pause and .../player/seek to test spotify.py against, the same way
fakes.py stands in for real HEOS hardware."""
import json
@@ -27,6 +27,7 @@ class FakeSpotify(threading.Thread):
self.reject_refresh = False # simulate a revoked refresh token
self.scope = "user-read-playback-state user-modify-playback-state"
self.player = None # GET /v1/me/player's body; None is no session (204)
self.queue = [] # GET /v1/me/player/queue's "queue"
self.forbid = None # a plain-text 403 body every API call answers with
fake = self
@@ -130,6 +131,12 @@ class FakeSpotify(threading.Thread):
else:
self._send(200, fake.player)
return
if self.path == "/v1/me/player/queue":
if not self._authorized():
self._send(401, {"error": {"message": "The access token expired"}})
return
self._send(200, {"currently_playing": None, "queue": fake.queue})
return
self._send(404, {"error": {"message": "not found"}})
self.server = HTTPServer(("127.0.0.1", 0), Handler)