Get the linkage conditions supported by the device

Last Updated on : 2023-12-07 03:33:47download

Acquire linkage conditions or standard function points for executing actions based on the device ID.

API address

GET: /v1.0/devices/{device_id}/enable-linkage/codes

Request parameter

Parameter nameTypeINRequiredDescription
device_idStringuritrueDevice ID

Return parameter

Parameter nameTypeDescription
resultDeviceResReturn result description

Description of result

Parameter nameTypeDescription
device_idStringDevice ID
functionsListStandard instructions for performing actions
statusListOperation trigger conditions

Description of functions

Parameter nameTypeDescription
codeStringStandard issued instruction Code
nameStringCode Name
typeStringSend data type, currently supports the following three types
  • Boolean
  • Integer
  • Enum
valuesMapThe value range corresponding to Code

Description of status

Parameter nameTypeDescription
codeStringStandard issued instruction Code
nameStringCode Name
typeStringSend data type, currently supports the following three types
  • Boolean
  • Integer
  • Enum
valuesMapThe value range corresponding to Code

Description of values

Parameter nameTypeDescription
valuesString

Request example

GET: /v1.0/devices/0120090568c63a89****/enable-linkage/codes

Return example

{
    "device_id": "xxxid",
    "functions": [
        {
            "code": "bright_value",
            "values": {
                "max": 255,
                "scale": 0,
                "type": "Integer",
                "unit": "",
                "min": 25,
                "step": 1
            },
            "type": "Integer",
            "name": "bright"
        },
        {
            "code": "switch_led",
            "values": {
                "type": "Boolean"
            },
            "type": "Boolean",
            "name": "switch"
        }
    ],
    "status": [
        {
            "code": "work_mode",
            "values": {
                "range": [
                    "white",
                    "colour",
                    "scene",
                    "scene_1",
                    "scene_2",
                    "scene_3",
                    "scene_4"
                ],
                "type": "Enum"
            },
            "type": "Enum",
            "name": "mode"
        }
    ]
}

Error code

For more information, see error code.