Add a device override to the PLM.
168119
def add_device_override(self, addr, cat, subcat, firmware=None):
        """"""
        self.plm.devices.add_override(addr, 'cat', cat)
        self.plm.devices.add_override(addr, 'subcat', subcat)
        if firmware:
            self.plm.devices.add_override(addr, 'firmware', firmware)
1205456
def add_adapter(self, adapter):
        """"""

        if self._started:
            raise InternalError("New adapters cannot be added after start() is called")

        if isinstance(adapter, DeviceAdapter):
            self._logger.warning("Wrapping legacy device adapter %s in async wrapper", adapter)
            adapter = AsynchronousModernWrapper(adapter, loop=self._loop)

        self.adapters.append(adapter)

        adapter_callback = functools.partial(self.handle_adapter_event,
                                             len(self.adapters) - 1)
        events = ['device_seen', 'broadcast', 'report', 'connection',
                  'disconnection', 'trace', 'progress']

        adapter.register_monitor([None], events, adapter_callback)
932488
def _add_saved_device_info(self, **kwarg):
        """"""
        addr = kwarg.get('address')
        _LOGGER.debug('Found saved device with address %s', addr)
        self._saved_devices[addr] = kwarg
1336231
function Device (device, sp) {
  if (!(device && sp))
    throw new Error('a Device and a SerialPort must be passed');

  for (var i in device)
    this[i] = device[i];

  this._open = false;
  this._sp = sp;

  EventEmitter.call(this);
}
666130
def _interfaces_added(self, object_path, interfaces_and_properties):
        """"""
        added = object_path not in self._objects
        self._objects.setdefault(object_path, {})
        old_state = copy(self._objects[object_path])
        self._objects[object_path].update(interfaces_and_properties)
        new_state = self._objects[object_path]
        if added:
            kind = object_kind(object_path)
            if kind in ('device', 'drive'):
                self.trigger('device_added', self[object_path])

        if Interface['Block'] in interfaces_and_properties:
            slave = self[object_path].luks_cleartext_slave
            if slave:
                if not self._has_job(slave.object_path, 'device_unlocked'):
                    self.trigger('device_unlocked', slave)

        if not added:
            self.trigger('device_changed',
                         self.get(object_path, old_state),
                         self.get(object_path, new_state))
1157394
def init_device(self):
        """"""
        Device.init_device(self)

        # Add anything here that has to be done before the device is set to
        # its ON state.

        self._set_master_state('on')
        self._devProxy = DeviceProxy(self.get_name())
1054485
function addDeviceXPubKey(wallet, device_address, xPubKey, onDone){
	db.query(
		"INSERT "+db.getIgnore()+" INTO extended_pubkeys (wallet, device_address) VALUES(?,?)",
		[wallet, device_address],
		function(){
			db.query(
				"UPDATE extended_pubkeys SET extended_pubkey=?, approval_date="+db.getNow()+" WHERE wallet=? AND device_address=?", 
				[xPubKey, wallet, device_address],
				function(){
					eventBus.emit('wallet_approved', wallet, device_address);
					checkAndFullyApproveWallet(wallet, onDone);
				}
			);
		}
	);
}
1187161
def add_group(self, name, devices):
        
        device = self.add_device(name, "group")
        device.add_to_group(devices)
        return device
875941
def attach_hardware(self, ticket_id=None, hardware_id=None):
        
        return self.ticket.addAttachedHardware(hardware_id, id=ticket_id)
289746
def add_device(self, model, serial):
        
        device = {
                'model': model,
                'vendor': self.vendor(),
                'sn': serial,
                'type': 'vendor'
        }
        headers = {
                'User-Agent': self.user_agent(),
        }
        headers.update(self.headers())

        r = requests.post(  self.portals_url()+'/portals/'+self.portal_id()+'/devices', 
                                data=json.dumps(device),
                                headers=headers,
                                auth=self.auth())

        if HTTP_STATUS.ADDED == r.status_code:
            # fix the 'meta' to be dictionary instead of string
            device_obj = r.json()
            return dictify_device_meta(device_obj)
        else:
            print("add_device: Something went wrong: <{0}>: {1}".format(
                        r.status_code, r.reason))
            r.raise_for_status()
1161807
public DeviceEnvelope addDevice(Device device) throws ApiException {
        ApiResponse<DeviceEnvelope> resp = addDeviceWithHttpInfo(device);
        return resp.getData();
    }
936658
def add_x10_device(self, housecode, unitcode, dev_type):
        """"""
        device = None
        try:
            device = self.plm.devices.add_x10_device(self.plm, housecode,
                                                     unitcode, dev_type)
        except ValueError:
            pass
        return device
340308
def create_device_from_category(self, plm, addr, cat, subcat,
                                    product_key=0x00):
        """"""
        saved_device = self._saved_devices.get(Address(addr).id, {})
        cat = saved_device.get('cat', cat)
        subcat = saved_device.get('subcat', subcat)
        product_key = saved_device.get('product_key', product_key)

        device_override = self._overrides.get(Address(addr).id, {})
        cat = device_override.get('cat', cat)
        subcat = device_override.get('subcat', subcat)
        product_key = device_override.get('firmware', product_key)
        product_key = device_override.get('product_key', product_key)

        return insteonplm.devices.create(plm, addr, cat, subcat, product_key)
170239
def create_x10(plm, housecode, unitcode, feature):
    """"""
    from insteonplm.devices.ipdb import IPDB
    ipdb = IPDB()
    product = ipdb.x10(feature)
    deviceclass = product.deviceclass
    device = None
    if deviceclass:
        device = deviceclass(plm, housecode, unitcode)
    return device
68708
def add_device(self, resource_name, device):
        

        if device.resource_name is not None:
            msg = 'The device %r is already assigned to %s'
            raise ValueError(msg % (device, device.resource_name))

        device.resource_name = resource_name

        self._internal[device.resource_name] = device
387389
def kpl_on(self, address, group):
        """"""
        addr = Address(address)
        device = self.plm.devices[addr.id]
        device.states[group].on()
181684
def add_device(dev):
    """"""
    global DEV_IDX, DEFAULT_DEV
    with DEV_LOCK:
        for idx in range(len(DEVS)):
            test_dev = DEVS[idx]
            if test_dev.dev_name_short == dev.dev_name_short:
                # This device is already in our list. Delete the old one
                if test_dev is DEFAULT_DEV:
                    DEFAULT_DEV = None
                del DEVS[idx]
                break
        if find_device_by_name(dev.name):
            # This name is taken - make it unique
            dev.name += '-%d' % DEV_IDX
        dev.name_path = '/' + dev.name + '/'
        DEVS.append(dev)
        DEV_IDX += 1
        if DEFAULT_DEV is None:
            DEFAULT_DEV = dev