def set_channel(self, channel, toggle_position):
    ' Enable / disable channels '
    try:
        if (channel > self.num_channels):
            raise ValueError('Cannot set non-existant channel')
        if (toggle_position == 1):
            if (channel is 1):
                self.wifi_write('!')
            if (channel is 2):
                self.wifi_write('@')
            if (channel is 3):
                self.wifi_write('#')
            if (channel is 4):
                self.wifi_write('$')
            if (channel is 5):
                self.wifi_write('%')
            if (channel is 6):
                self.wifi_write('^')
            if (channel is 7):
                self.wifi_write('&')
            if (channel is 8):
                self.wifi_write('*')
            if (channel is 9):
                self.wifi_write('Q')
            if (channel is 10):
                self.wifi_write('W')
            if (channel is 11):
                self.wifi_write('E')
            if (channel is 12):
                self.wifi_write('R')
            if (channel is 13):
                self.wifi_write('T')
            if (channel is 14):
                self.wifi_write('Y')
            if (channel is 15):
                self.wifi_write('U')
            if (channel is 16):
                self.wifi_write('I')
        elif (toggle_position == 0):
            if (channel is 1):
                self.wifi_write('1')
            if (channel is 2):
                self.wifi_write('2')
            if (channel is 3):
                self.wifi_write('3')
            if (channel is 4):
                self.wifi_write('4')
            if (channel is 5):
                self.wifi_write('5')
            if (channel is 6):
                self.wifi_write('6')
            if (channel is 7):
                self.wifi_write('7')
            if (channel is 8):
                self.wifi_write('8')
            if (channel is 9):
                self.wifi_write('q')
            if (channel is 10):
                self.wifi_write('w')
            if (channel is 11):
                self.wifi_write('e')
            if (channel is 12):
                self.wifi_write('r')
            if (channel is 13):
                self.wifi_write('t')
            if (channel is 14):
                self.wifi_write('y')
            if (channel is 15):
                self.wifi_write('u')
            if (channel is 16):
                self.wifi_write('i')
    except Exception as e:
        print(('Something went wrong while setting channels: ' + str(e)))
Enable / disable channels
def set_channel(self, channel, toggle_position):
    '  '
    try:
        if (channel > self.num_channels):
            raise ValueError('Cannot set non-existant channel')
        if (toggle_position == 1):
            if (channel is 1):
                self.wifi_write('!')
            if (channel is 2):
                self.wifi_write('@')
            if (channel is 3):
                self.wifi_write('#')
            if (channel is 4):
                self.wifi_write('$')
            if (channel is 5):
                self.wifi_write('%')
            if (channel is 6):
                self.wifi_write('^')
            if (channel is 7):
                self.wifi_write('&')
            if (channel is 8):
                self.wifi_write('*')
            if (channel is 9):
                self.wifi_write('Q')
            if (channel is 10):
                self.wifi_write('W')
            if (channel is 11):
                self.wifi_write('E')
            if (channel is 12):
                self.wifi_write('R')
            if (channel is 13):
                self.wifi_write('T')
            if (channel is 14):
                self.wifi_write('Y')
            if (channel is 15):
                self.wifi_write('U')
            if (channel is 16):
                self.wifi_write('I')
        elif (toggle_position == 0):
            if (channel is 1):
                self.wifi_write('1')
            if (channel is 2):
                self.wifi_write('2')
            if (channel is 3):
                self.wifi_write('3')
            if (channel is 4):
                self.wifi_write('4')
            if (channel is 5):
                self.wifi_write('5')
            if (channel is 6):
                self.wifi_write('6')
            if (channel is 7):
                self.wifi_write('7')
            if (channel is 8):
                self.wifi_write('8')
            if (channel is 9):
                self.wifi_write('q')
            if (channel is 10):
                self.wifi_write('w')
            if (channel is 11):
                self.wifi_write('e')
            if (channel is 12):
                self.wifi_write('r')
            if (channel is 13):
                self.wifi_write('t')
            if (channel is 14):
                self.wifi_write('y')
            if (channel is 15):
                self.wifi_write('u')
            if (channel is 16):
                self.wifi_write('i')
    except Exception as e:
        print(('Something went wrong while setting channels: ' + str(e)))