This commit is contained in:
1 parent
0560079b16
commit
db00e57ef7
9 files changed
+328
-228
No files matched your search
@@ -7,6 +7,7 @@ network -- and lets the panel be tested without waking the house up.
|
||||
import time
|
||||
|
||||
from controller import stepped_level
|
||||
from zidoo import ZidooError
|
||||
|
||||
|
||||
class _FakeAvr:
|
||||
@@ -61,6 +62,7 @@ class DemoController:
|
||||
# Its play button only shows for a stream one of your accounts plays.
|
||||
self._account = next(iter(cfg.SPOTIFY_ACCOUNTS), None)
|
||||
self._film_ms = 241000 # where the pretend Zidoo's film is, so a seek sticks
|
||||
self._film_play = "play" # and whether it runs, so its play button sticks too
|
||||
|
||||
# -- what the UI uses ---------------------------------------------
|
||||
def state(self):
|
||||
@@ -80,7 +82,8 @@ class DemoController:
|
||||
# Standing in for a Zidoo plugged into this input, so the
|
||||
# AVR card's now-playing block has something to show here too.
|
||||
"now_playing": {"song": "Big Buck Bunny", "artist": "2008", "image": None,
|
||||
"play_state": "play", "position_ms": self._film_ms, "duration_ms": 596000}
|
||||
"play_state": self._film_play,
|
||||
"position_ms": self._film_ms, "duration_ms": 596000}
|
||||
if self.avr.current_input()["code"] == self.cfg.ZIDOO_INPUT_CODE else None,
|
||||
},
|
||||
"heos_ok": True,
|
||||
@@ -125,6 +128,14 @@ class DemoController:
|
||||
self._joined = {k for k in self.cfg.ROOM_KEYS if k in joined}
|
||||
return self.joined_keys()
|
||||
|
||||
def zidoo_play_state(self, state=None):
|
||||
if state is None:
|
||||
state = "pause" if self._film_play == "play" else "play"
|
||||
if state not in ("play", "pause"):
|
||||
raise ZidooError(f"The Zidoo has no key for '{state}' -- only play and pause")
|
||||
self._film_play = state
|
||||
return state
|
||||
|
||||
def zidoo_seek(self, position_ms):
|
||||
self._film_ms = min(596000, int(position_ms))
|
||||
|
||||
|
||||
Reference in new issue
Block a user