예제 #1
0
    def set_repeat(self, repeat_mode):
        """Change repeat mode."""
        if int(repeat_mode) == RepeatState.Off:
            state = 1
        elif int(repeat_mode) == RepeatState.All:
            state = 2
        elif int(repeat_mode) == RepeatState.Track:
            state = 3
        else:
            raise ValueError('Invalid repeat mode: ' + str(repeat_mode))

        return self.protocol.send(messages.repeat(state))
예제 #2
0
    def set_repeat(self, repeat_mode):
        """Change repeat mode."""
        # TODO: extract to convert module
        if int(repeat_mode) == const.REPEAT_STATE_OFF:
            state = 1
        elif int(repeat_mode) == const.REPEAT_STATE_ALL:
            state = 2
        elif int(repeat_mode) == const.REPEAT_STATE_TRACK:
            state = 3
        else:
            raise ValueError('Invalid repeat mode: ' + str(repeat_mode))

        return self.protocol.send(messages.repeat(state))
예제 #3
0
파일: __init__.py 프로젝트: paxswill/pyatv
 async def set_repeat(self, repeat_state: RepeatState) -> None:
     """Change repeat state."""
     await self.protocol.send_and_receive(messages.repeat(repeat_state))
예제 #4
0
파일: __init__.py 프로젝트: Lee-View/pyatv
 def set_repeat(self, repeat_state):
     """Change repeat state."""
     return self.protocol.send(messages.repeat(repeat_state))