Ejemplo n.º 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))
Ejemplo n.º 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))
Ejemplo n.º 3
0
 async def set_repeat(self, repeat_state: RepeatState) -> None:
     """Change repeat state."""
     await self.protocol.send_and_receive(messages.repeat(repeat_state))
Ejemplo n.º 4
0
 def set_repeat(self, repeat_state):
     """Change repeat state."""
     return self.protocol.send(messages.repeat(repeat_state))