Skip to content

灯具管理 ​

字段路径以消息数组中的单个对象为起点。[] 表示数组元素,例如 services[].rid 表示每个服务的 rid;value 对象中的字段使用 value.name、value.color_arr[].x 等路径表示。

一. 灯具更新 ​

1. topic ​

res/light/update

2. payload ​
json
[
    {
        "device_id": "10E48D35-0ABD-47EB-BA4B-C150D68C4B23",
        "id": "8BAD2C8A-38BE-41CB-A4D3-563B5C7E9C03",
        "value": {
            "brightness": 74,
            "color_arr": [
                {
                    "x": 26839,
                    "y": 28098
                },
                {
                    "x": 22993,
                    "y": 29119
                },
                {
                    "x": 21025,
                    "y": 24022
                },
                {
                    "x": 18600,
                    "y": 24633
                },
                {
                    "x": 10591,
                    "y": 23416
                }
            ],
            "color_len": 5
        }
    }
]
3. 字段说明 ​
字段类型说明
idstring灯具的ID
device_idstring设备的ID
valueobject有更新的字段

value对象

字段类型说明
value.oninteger开关, 1开, 0关
value.brightnessinteger亮度, 范围 0 - 100
value.color_modeinteger颜色模式, 1xy, 2cw, 3xy array
value.color_xintegerxy模式时的 x值, 范围 1 - 65535
value.color_yintegerxy模式时的 y值, 范围 1 - 65535
value.color_cwintegercw模式时的 cw值, 范围 2000 - 6500
value.color_arrobject[]xy array模式时的 xy数组
value.color_arr[].xintegerx值
value.color_arr[].yintegery值
value.sync_statusinteger灯具是否在同步中, 1是, 0否
value.position_xintegerBweeApp专用, 色盘中的x坐标
value.position_yintegerBweeApp专用, 色盘中的y坐标
value.positionsstringBweeApp专用, 分段色时, 多个坐标
value.packstring[]BweeApp专用, 多个灯组合在一起
4. 功能说明 ​
  • 在灯具信息变更时, 会触发此 topic
  • value对象中, key存在代表有更新, key不存在代表未更新