灯具管理
字段路径以消息数组中的单个对象为起点。[] 表示数组元素,例如 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. 字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | 灯具的ID |
device_id | string | 设备的ID |
value | object | 有更新的字段 |
value对象
| 字段 | 类型 | 说明 |
|---|---|---|
value.on | integer | 开关, 1开, 0关 |
value.brightness | integer | 亮度, 范围 0 - 100 |
value.color_mode | integer | 颜色模式, 1xy, 2cw, 3xy array |
value.color_x | integer | xy模式时的 x值, 范围 1 - 65535 |
value.color_y | integer | xy模式时的 y值, 范围 1 - 65535 |
value.color_cw | integer | cw模式时的 cw值, 范围 2000 - 6500 |
value.color_arr | object[] | xy array模式时的 xy数组 |
value.color_arr[].x | integer | x值 |
value.color_arr[].y | integer | y值 |
value.sync_status | integer | 灯具是否在同步中, 1是, 0否 |
value.position_x | integer | BweeApp专用, 色盘中的x坐标 |
value.position_y | integer | BweeApp专用, 色盘中的y坐标 |
value.positions | string | BweeApp专用, 分段色时, 多个坐标 |
value.pack | string[] | BweeApp专用, 多个灯组合在一起 |
4. 功能说明
- 在灯具信息变更时, 会触发此 topic
- value对象中, key存在代表有更新, key不存在代表未更新