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