Skip to content

component

Required: No
Type: List of objects
Condition: No

List of components to be added to the project.

Key Required Type Description
id Yes String ID of the component
instance If instantiable List of strings List of instance names if the component is instantiable. Since instance names must be usable as variables in C code, input must be restricted to /[A-Za-z0-9_]+/.
from If from a SDK extension String The ID of the SDK extension the component is from. Only SDK extensions listed using the sdk_extension key may be used.
condition No List of features The component is added if all the given features are present

A component with the same id (and from if applicable) may be listed multiple times with different conditions. If any of the entries apply to the project (features to activate the condition are present), the component is added to the project. If the component is instantiable and multiple entries apply but provide different lists of instances, the union of all instances requested by the applicable entries are created.

Example

Basic example:

1
2
3
4
5
6
component:
  - id: iostream
  - id: simple_button
    instance: [btn0, btn1]
  - id: wisun_stack
    from: wisun

Example of multiple instances across multiple entries:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
component:
  - id: foo
    instance: [one, two]
    condition: [tuna]
  - id: foo
    instance: [three]
    condition: [salmon]
  - id: foo
    instance: [four]
  - id: foo
    instance: [four, five]
    condition: [cod]

If the features tuna and cod are present, the component foo is instantiated with the instances one, two, four and five. The two requests for an instance four are deduplicated. The instance three is not created, since salmon is not present.

Back to top