feat(heartbeat): 添加版本号字段并处理亮度值-1为NULL

- 在心跳事件表中新增 version 字段,用于存储版本号信息
- 将 bright_g 字段的 -1 值映射为数据库中的 NULL,避免语义混淆
- 更新相关文档、数据库迁移脚本和测试用例
This commit is contained in:
2026-01-28 17:47:05 +08:00
parent 1644ee80bc
commit ad270bd936
6 changed files with 45 additions and 4 deletions

View File

@@ -40,7 +40,8 @@
| electricity | array<object> | [{"address":"add11","voltage":3.2,...}] | 电力设备数组(按原始顺序拆列落库为数组列) |
| air_conditioner | array<object> | [{"address":"ac1","state":1,...}] | 空调设备数组(按原始顺序拆列落库为数组列) |
| insert_card | number/int | 1 | 是否插卡(整数,可为空) |
| bright_g | number/int | 80 | 全局亮度值(整数,可为空) |
| bright_g | number/int | 80 | 全局亮度值(整数,可为空;若为 -1 则落库为 null |
| version | number/int | 1 | 版本号int2/short可为空 |
## 4. JSON 示例
```json
@@ -60,6 +61,7 @@
"comm_seq": 7,
"insert_card": 1,
"bright_g": 80,
"version": "1.3.0",
"electricity": [
{
"address": "add11",