mapMatterDpState(dpState: DpState, updateDpState: DpState, dpSchema: DpSchema, shouldConvert?: boolean)
版本要求:
≥1.15.0
描述
将 Matter DP 状态映射为标准 DP 状态(上报 / 合并场景:matterDpState → standardDpState)。
参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| 是 | 当前完整 DP 状态 | ||
| 是 | 本次变更涉及的 DP 子集,用于判断需转换的键 | ||
| 是 | dpSchema 对象 | ||
shouldConvert | boolean | 否 | 是否做数值换算;默认 true(与拦截器内 shouldConvert 语义配合) |
返回值
类型:DpState
转换后的 Matter DP 状态
引用对象
type
DpValue功能点值类型,可能为 boolean、number、string合法值
DpSchema.mode
| 值 | 说明 | 最低版本 |
|---|---|---|
rw | - | - |
ro | - | - |
wr | - | - |
DpSchema.property.type
| 值 | 说明 | 最低版本 |
|---|---|---|
string | - | - |
bool | - | - |
value | - | - |
enum | - | - |
bitmap | - | - |
raw | - | - |
DpSchema.type
| 值 | 说明 | 最低版本 |
|---|---|---|
raw | - | - |
obj | - | - |