async def handle_set_property(self, request): """Handle property changes.""" self._verify_auth_parameters(request) if "dacp.playingtime" in request.rel_url.query: playtime = int(request.rel_url.query["dacp.playingtime"]) self.state.playing.position = int(playtime / 1000) elif "dacp.shufflestate" in request.rel_url.query: shuffle = int(request.rel_url.query["dacp.shufflestate"]) self.state.playing.shuffle = (ShuffleState.Songs if shuffle == 1 else ShuffleState.Off) elif "dacp.repeatstate" in request.rel_url.query: repeat = int(request.rel_url.query["dacp.repeatstate"]) self.state.playing.repeat = RepeatState(repeat) else: web.Response(body=b"", status=500) return web.Response(body=b"", status=200)
def repeat(self): """Repeat mode.""" state = parser.first(self.playstatus, "cmst", "carp") if state is None: return RepeatState.Off return RepeatState(state)
def repeat() -> Optional[RepeatState]: """Repeat mode.""" state = parser.first(playstatus, "cmst", "carp") if state is None: return RepeatState.Off return RepeatState(state)
def repeat(self): """Repeat mode.""" state = parser.first(self.playstatus, 'cmst', 'carp') return None if state is None else RepeatState(state)