code: def CreateDevice(self, device_address):
      '''Create a new device '''
      device_name = 'dev_' + device_address.replace(':', '_').upper()
      adapter_path = self.path
      path = adapter_path + '/' + device_name
  
      if path not in mockobject.objects:
          raise dbus.exceptions.DBusException(
              'Could not create device for %s.' % device_address,
              name='org.bluez.Error.Failed')
  
      adapter = mockobject.objects[self.path]
      adapter.EmitSignal(ADAPTER_IFACE, 'DeviceCreated',
                         'o', [dbus.ObjectPath(path, variant_level=1)])
  
      return dbus.ObjectPath(path, variant_level=1f CreateDevice(self, device_address):
      '''Create a new device '''
      device_name = 'dev_' + device_address.replace(':', '_').upper()
      adapter_path = self.path
      path = adapter_path + '/' + device_name
  
      if path not in mockobject.objects:
          raise dbus.exceptions.DBusException(
              'Could not create device for %s.' % device_address,
              name='org.bluez.Error.Failed')
  
      adapter = mockobject.objects[self.path]
      adapter.EmitSignal(ADAPTER_IFACE, 'DeviceCreated',
                         'o', [dbus.ObjectPath(path, variant_level=1)])
  
      return dbus.ObjectPath(path, variant_level=1)
docs: Create a new device