mapMatterDpState(dpState: DpState, updateDpState: DpState, dpSchema: DpSchema, shouldConvert?: boolean)

Requires:
≥1.15.0

Description

Map Matter DP state to standard DP state (report/merge scenario: matterDpState → standardDpState).

Parameters

ParameterTypeRequiredDescription
YesCurrent full DP state
YesSubset of DPs involved in this change, used to determine which keys to convert
YesdpSchema object
shouldConvertbooleanNoWhether to perform numeric conversion; defaults to true (aligned with shouldConvert semantics in the interceptor)

Return Value

Type: DpState
Converted Matter DP state

Referenced Types

typeDpValueDatapoint value type, which can be boolean, number, or string.
export type DpValue = boolean | number | string;

Valid Values

DpSchema.mode
ValueDescriptionSince
rw--
ro--
wr--
DpSchema.property.type
ValueDescriptionSince
string--
bool--
value--
enum--
bitmap--
raw--
DpSchema.type
ValueDescriptionSince
raw--
obj--

Examples

Example

import { createMatterKit } from '@ray-js/panel-sdk';

const matterKit = createMatterKit();
const next = matterKit.mapMatterDpState(dpState, updateDpState, dpSchema);