2995840376
6461acecd1
feat(B5-B7): 引入 SpecSemanticResolver 作为物模型语义唯一权威
新增 SpecSemanticResolver (356行):
- 语义标签体系: power/switch/backlight/indicator/brightness/color_temp/
mode/scene/countdown/child_lock/temperature/humidity/battery/motion/
contact/fault/raw
- 功能分组 grp: switch/scene/mode/countdown/display/config/measure/status
- resolve(): 单功能点语义推导(非主控词优先 -> 功能语义 -> 开关兜底)
- pickPrimary(): 产品范围内选主开关(power优先 -> switch组首个 -> 唯一可写bool兜底)
- isReadOnly(): 只读语义修正, 修复涂鸦 fnCodes 为空时兜底'全部可写'的缺陷
实体/DTO 补齐语义字段(V19 建了列但代码里没有):
- ProductProperty: semantic/grp/isPrimary/channel/completionMode/enumLabel
- ProductAction: completionMode
- ControlItem: semantic/grp/isPrimary/enumLabels
ControlSchemaServiceImpl 改造:
- toItem(): 搬运语义字段; 物模型无语义时即时推导(旧数据兼容);
状态量被误标 write 时强制只读
- pickMainSwitch(): 优先 is_primary -> semantic=power -> 回退旧启发式
(原实现按名称含 switch/power 猜测, 是 JD2BTSA 背光误控的根因)
- fillValues(): code 优先、dp_id 兜底(修复 dps key 语义分裂导致回填失败)
ProductServiceImpl.reconcileSpecFromTuya:
- 同步物模型时落库 semantic/grp, 并用语义修正 access
- 新增 applyPrimary(): 选主开关并回填 is_primary
验证: mvn -pl iot-common,iot-device -am compile 通过
2026-10-27 12:32:06 +08:00
..
2026-10-27 12:00:41 +08:00
2026-10-27 12:00:41 +08:00
2026-10-27 12:08:44 +08:00
2026-10-27 12:00:41 +08:00
2026-10-27 12:32:06 +08:00
2026-10-27 12:00:41 +08:00
2026-10-27 12:08:44 +08:00
2026-10-27 12:00:41 +08:00
2026-10-27 12:00:41 +08:00
2026-10-27 12:00:41 +08:00