code: def set_status(self, on, switch=1):
          
          # open device, send request, then close connection
          if isinstance(switch, int):
              switch = str(switch)  # index and payload is a string
          payload = self.generate_payload(SET, {switch:on})
          #print('payload %r' % payload)
  
          data = self._send_receive(payload)
          log.debug('set_status received data=%r', data)
  
          return data
docs: Set status of the device to 'on' or 'off'.
          
          Args:
              on(bool):  True for 'on', False for 'off'.
              switch(int): The switch to set