Add a device to a group. Wraps JSSObject.add_object_to_path.

        Args:
            device: A JSSObject to add (as list data), to this object.
            location: Element or a string path argument to find()
175607
def add_device(self, device, container):
        
        # There is a size tag which the JSS manages for us, so we can
        # ignore it.
        if self.findtext("is_smart") == "false":
            self.add_object_to_path(device, container)
        else:
            # Technically this isn't true. It will strangely accept
            # them, and they even show up as members of the group!
            raise ValueError("Devices may not be added to smart groups.")
240570
public Device addDevice(String id, String token) throws DuplicateDeviceException, NullIdException, NullDeviceTokenException, Exception {
		if ((id == null) || (id.trim().equals(""))) {
			throw new NullIdException();
		} else if ((token == null) || (token.trim().equals(""))) {
			throw new NullDeviceTokenException();
		} else {
			if (!this.devices.containsKey(id)) {
				token = token.trim().replace(" ", "");
				BasicDevice device = new BasicDevice(id, token, new Timestamp(Calendar.getInstance().getTime().getTime()));
				this.devices.put(id, device);
				return device;
			} else {
				throw new DuplicateDeviceException();
			}
		}
	}
684588
def device_set(self, device):
		

		if device['id'].startswith('0x'):
			self.device_id = device['id'][2:]
		elif device['id'].startswith('ios:'):
			self.device_id = device['id'].replace(':', '')
		else:
			self.device_id = device['id']
690520
void putDevice(Context context, boolean collectDeviceID) {
    Device device = new Device();
    String identifier = collectDeviceID ? getDeviceId(context) : traits().anonymousId();
    device.put(Device.DEVICE_ID_KEY, identifier);
    device.put(Device.DEVICE_MANUFACTURER_KEY, Build.MANUFACTURER);
    device.put(Device.DEVICE_MODEL_KEY, Build.MODEL);
    device.put(Device.DEVICE_NAME_KEY, Build.DEVICE);
    put(DEVICE_KEY, device);
  }
1216292
def on(self, dev_id):
        
        path = 'device/on'
        payload = {'id': dev_id}
        return self.rachio.put(path, payload)
965868
def add_device():
    
    req = request.get_json()
    success = False
    if 'device_id' in req and 'host' in req:
        success = add(req['device_id'], req['host'], req.get('adbkey', ''), req.get('adb_server_ip', ''), req.get('adb_server_port', 5037))
    return jsonify(success=success)
175632
async def mount(self, device):
        
        device = self._find_device(device)
        if not self.is_handleable(device) or not device.is_filesystem:
            self._log.warn(_('not mounting {0}: unhandled device', device))
            return False
        if device.is_mounted:
            self._log.info(_('not mounting {0}: already mounted', device))
            return True
        options = match_config(self._config, device, 'options', None)
        kwargs = dict(options=options)
        self._log.debug(_('mounting {0} with {1}', device, kwargs))
        self._check_device_before_mount(device)
        mount_path = await device.mount(**kwargs)
        self._log.info(_('mounted {0} on {1}', device, mount_path))
        return True
118790
def add_to_group(self, devices):
        """"""
        ids = {d.id for d in self.devices_in_group()}
        ids.update(self._device_ids(devices))
        self._set_group(ids)
1348409
def add_device(self, name, protocol, model=None, **parameters):
        
        device = Device(self.lib.tdAddDevice(), lib=self.lib)
        try:
            device.name = name
            device.protocol = protocol
            if model:
                device.model = model
            for key, value in parameters.items():
                device.set_parameter(key, value)

            # Return correct type
            return DeviceFactory(device.id, lib=self.lib)
        except Exception:
            import sys
            exc_info = sys.exc_info()
            try:
                device.remove()
            except:
                pass

            if "with_traceback" in dir(Exception):
                raise exc_info[0].with_traceback(exc_info[1], exc_info[2])
            else:
                exec("raise exc_info[0], exc_info[1], exc_info[2]")
382174
function Device (client, opts) {
  var self = this
  if (!(self instanceof Device)) return new Device(client, opts)
  if (!opts) opts = {}

  self.client = client
}
501943
def device(self, device_id, *args, **kwargs):
        
        return Device(device_id, self.corsair_sdk, self._corsair_sdk_path, *args, **kwargs)
1209450
def device_path(cls, project, location, registry, device):
        """"""
        return google.api_core.path_template.expand(
            "projects/{project}/locations/{location}/registries/{registry}/devices/{device}",
            project=project,
            location=location,
            registry=registry,
            device=device,
        )
500569
def create_device(name, address, type)
      Device.new(
        name:     name.gsub(/\u00a0/, ' '),
        address:  address,
        type:     type
      )
    end
1039686
def start_device(name, frontend, backend):
    
    device = getattr(devices, name)
    device(frontend, backend)
517299
private void pullDeviceFiles(IDevice device) throws Exception {
    for (String dir : DEVICE_DIRS) {
      pullDirectory(device, dir);
    }
  }
547027
def device(self, name):
        
        for device in self.devices():
            if device.name.lower() == name.lower():
                return device
        raise NotFound('Unable to find device %s' % name)
202576
def has_member(self, device_object):
        
        if device_object.tag == "computer":
            container_search = "computers/computer"
        elif device_object.tag == "mobile_device":
            container_search = "mobile_devices/mobile_device"
        else:
            raise ValueError

        return len([device for device in self.findall(container_search) if
                    device.findtext("id") == device_object.id]) is not 0