コード例 #1
0
ファイル: dmap.py プロジェクト: thomasrockhu/pyatv
    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)
コード例 #2
0
 def repeat(self):
     """Repeat mode."""
     state = parser.first(self.playstatus, "cmst", "carp")
     if state is None:
         return RepeatState.Off
     return RepeatState(state)
コード例 #3
0
 def repeat() -> Optional[RepeatState]:
     """Repeat mode."""
     state = parser.first(playstatus, "cmst", "carp")
     if state is None:
         return RepeatState.Off
     return RepeatState(state)
コード例 #4
0
ファイル: __init__.py プロジェクト: dschu012/pyatv
 def repeat(self):
     """Repeat mode."""
     state = parser.first(self.playstatus, 'cmst', 'carp')
     return None if state is None else RepeatState(state)