Create and add a child sensor.
558334
def add_child_sensor(self, child_id, child_type, description=''):
        """"""
        if child_id in self.children:
            _LOGGER.warning(
                'child_id %s already exists in children of node %s, '
                'cannot add child', child_id, self.sensor_id)
            return None
        self.children[child_id] = ChildSensor(
            child_id, child_type, description)
        return child_id
1217673
def add_children(self, *children, **kwargs):
        """"""
        for child in children:
            self.add_child(child, **kwargs)
988701
def _append_node(self, child):
        """"""
        # pylint: disable=no-member; depending by the class
        # which uses the current class as a mixin or base class.
        # It's rewritten in 2.0, so it makes no sense for now
        # to spend development time on it.
        self.body.append(child)
        child.parent = self
140837
def add_to_parent(self):
        """"""
        parent = self.parent
        if parent is not None:
            try:
                children = parent.children
            except AttributeError: pass
            else:
                include(children, self)
537769
function addChildAt(child, index) {
         if (index >= 0 && index < this.children.length) {
           if (child.ancestor instanceof me.Container) {
             child.ancestor.removeChildNow(child);
           } else {
             // only allocate a GUID if the object has no previous ancestor
             // (e.g. move one child from one container to another)
             if (child.isRenderable) {
               // allocated a GUID value
               child.GUID = me.utils.createGUID();
             }
           }

           child.ancestor = this;
           this.children.splice(index, 0, child);

           if (typeof child.onActivateEvent === "function" && this.isAttachedToRoot()) {
             child.onActivateEvent();
           }

           this.onChildChange.call(this, index);
           return child;
         } else {
           throw new Error("Index (" + index + ") Out Of Bounds for addChildAt()");
         }
       }
1093740
function (sensorInfo, options) {
  Actuator.call(this, sensorInfo, options);

  if (sensorInfo.device.address) {
    this.gpio = new Gpio(sensorInfo.device.address, 'out');
    logger.info('powerSwitch sensor is created at driver', sensorInfo);
  } else {
    logger.warn('powerSwitch sensor address is not provided');
  }
}
441266
def add_child(self, child):
        """"""
        if not issubclass(child.__class__, SceneGraph):
            raise TypeError("child must have parent/child iteration implemented to be a node in a SceneGraph.")
        # if not hasattr(child, 'update'):
            # raise TypeError("child must have an attribute update()")

        child._parent = self
        self._children.append(child)
121510
def register_sensor(self, child):
        
        child_name = self._get_sensor_reference(child)
        if child_name in self._registered_sensors:
            raise ValueError("Sensor %r already registered with aggregate"
                             " tree" % child)
        self._registered_sensors[child_name] = child
        completed = []
        for parent, (_rule, names, sensors) in \
                self._incomplete_aggregates.iteritems():
            if child_name in names:
                names.remove(child_name)
                sensors.add(child)
                if not names:
                    completed.append(parent)
        for parent in completed:
            rule_function, _names, sensors = \
                self._incomplete_aggregates[parent]
            del self._incomplete_aggregates[parent]
            self.add(parent, rule_function, sensors)
309806
function() {

    this.childspawn = null;
    this.connected = false;
    this.uncertain = false;
    this.config = null;
    this.debug = true;
}
640728
def addChild(self, item):
        
        super(XGanttWidgetItem, self).addChild(item)
        
        item.sync()
1043437
def add(self, child):
        

        if isinstance(child, Component):
            self.add_child(child)
        else:
            raise ModelError('Unsupported child element')
387216
def insertChild(self, index, item):
        
        super(XGanttWidgetItem, self).insertChild(index, item)
        item.sync()
604625
def child_added(self, child):
        
        super(UiKitView, self).child_added(child)

        widget = self.widget
        #: TODO: Should index be cached?
        for i, child_widget in enumerate(self.child_widgets()):
            if child_widget == child.widget:
                widget.insertSubview(child_widget, atIndex=i)
364137
def add_to(self, parent, name=None, index=None):
        """"""
        parent.add_child(self, name=name, index=index)
        return self
999957
def add_values(self, values):
        ''''''
        if self.child.is_alive():
            self.parent_pipe.send(values)
563194
def create(cls, parent, child, relation_type, index=None):
        """"""
        try:
            with db.session.begin_nested():
                obj = cls(parent_id=parent.id,
                          child_id=child.id,
                          relation_type=relation_type,
                          index=index)
                db.session.add(obj)
        except IntegrityError:
            raise Exception("PID Relation already exists.")
            # msg = "PIDRelation already exists: " \
            #       "{0} -> {1} ({2})".format(
            #         parent_pid, child_pid, relation_type)
            # logger.exception(msg)
            # raise Exception(msg)
        return obj
1039482
def _new_sensor_reading(self, sensor_value):
        
        if not self._active and not self._enabled:
            return

        if self._dimensions > 1:
            for dimension in range(0, self._dimensions):
                value = sensor_value[dimension]
                self._sub_sensors[dimension]._new_sensor_reading(value)
        else:
            self._sensor_value.value = sensor_value