@@ -53,6 +53,10 @@ class DemoController:
|
||||
self._joined = set()
|
||||
# One room on Spotify and one not, so both kinds of card show up.
|
||||
self._spotify = {key: i == 0 for i, key in enumerate(cfg.ROOM_KEYS)}
|
||||
# No cover, since the demo has no network to fetch one from.
|
||||
self._track = {"song": "Harvest Moon", "artist": "Neil Young", "image": None}
|
||||
# Its play button only shows for a stream one of your accounts plays.
|
||||
self._account = next(iter(cfg.SPOTIFY_ACCOUNTS), None)
|
||||
|
||||
# -- what the UI uses ---------------------------------------------
|
||||
def state(self):
|
||||
@@ -61,7 +65,10 @@ class DemoController:
|
||||
"rooms": [
|
||||
{"key": key, "label": self.cfg.TARGETS[key]["label"], "available": True,
|
||||
"grouped": key in self._joined, "volume": self._volume[key],
|
||||
"play_state": self._play[key], "spotify": self._spotify[key], "error": None}
|
||||
"play_state": self._play[key], "spotify": self._spotify[key],
|
||||
"spotify_account": self._account if self._spotify[key] else None,
|
||||
"now_playing": self._track if self._spotify[key] and self._play[key] != "stop" else None,
|
||||
"error": None}
|
||||
for key in self.cfg.ROOM_KEYS
|
||||
],
|
||||
"avr": {"connected": True, "inputs": self.avr.inputs(), "input": self.avr.current_input()},
|
||||
|
||||
Reference in New Issue
Block a user