ym88659208ym87991671
Function dependencies (dependencies) | Documentation for developers

Function dependencies (dependencies)

Last updated on May 25, 2023

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.
FieldTypeMandatory?Description
dependenciesmap<string, object>✔︎Contains pairs of values: the dependent function and the function defining its availability
func_namestring✔︎Dependent device function means a function with its availability changing, depending on the state of another function.

List of functions (see Device functions)

keystring✔︎The function that determines the availability of the dependent function.

List of functions (see Device functions)

valuesobject✔︎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"
}
]
}
}
}
Sber process cookies only to personalize services according to Cookies Usage Policy. You can prevent the processing of cookies in your browser settings.