Function dependencies (dependencies)
Last updated on June 17, 2024
The structure is used to describe device models and defines dependencies of functions. A dependency is when one function will only be available if another one is in a certain state.
For example, colored lamps of certain models may work in two modes: colour mode and white light mode. Based on the mode chosen by the user, the set of available functions shall change:
- In case of the colour mode, a light colour change function appears.
- In case of the white light mode, the light colour change function must be blocked.
Field | Type | Mandatory? | Description |
dependencies | map<string, object> | ✔︎ | Contains pairs of values: the dependent function and the function defining its availability |
func_name | string | ✔︎ | Dependent device function means a function with its availability changing, depending on the state of another function. List of functions (see Device functions) |
key | string | ✔︎ | The function that determines the availability of the dependent function. List of functions (see Device functions) |
values | object | ✔︎ | The values of the key function at which the dependencies function becomes available (see Device function value (value)) |
{
"dependencies": {
"func_name": {
"key": string,
"value": [
{
"type": string,
"type_value": object
},
{
// ...
}
]
},
{
// ...
}
}
}
Function dependency description example
The example describes the dependency of the function light_colour (lighting colour) from the function light_mode (operation mode): the device's colour light can only be changed if it is switched to the colour mode.
{
"dependencies": {
"light_colour": {
"key": "light_mode",
"value": [
{
"type": "ENUM",
"enum_value": "colour"
}
]
}
}
}