code: def do_add_x10_device(self, args):
          
          params = args.split()
          housecode = None
          unitcode = None
          dev_type = None
  
          try:
              housecode = params[0]
              unitcode = int(params[1])
              if unitcode not in range(1, 17):
                  raise ValueError
              dev_type = params[2]
          except IndexError:
              pass
          except ValueError:
              _LOGGING.error('X10 unit code must be an integer 1 - 16')
              unitcode = None
  
          if housecode and unitcode and dev_type:
              device = self.tools.add_x10_device(housecode, unitcode, dev_type)
              if not device:
                  _LOGGING.error('Device not added. Please check the '
                                 'information you provided.')
                  self.do_help('add_x10_device')
          else:
              _LOGGING.error('Device housecode, unitcode and type are '
                             'required.')
              self.do_help('add_x10_device')
docs: Add an X10 device to the IM.
  
          Usage:
              add_x10_device housecode unitcode type
  
          Arguments:
              housecode: Device housecode (A - P)
              unitcode: Device unitcode  (1 - 16)
              type: Device type
  
          Current device types are:
              - OnOff
              - Dimmable
              - Sensor
  
          Example:
              add_x10_device M 12 OnOff