SmartGroupModel.getDpState()

Requires:
@ray-js/panel-sdk≥1.5.0

Description

Get smart group DP states

Parameters

None

Return Value

Type: DpState
Full DP state object where the key is the DP code and the value type is inferred from the Schema

Referenced Types

typeDpStateDatapoint status object, where the key is the datapoint code and the value is the datapoint value.
export type DpState = Record<string, DpValue>;
typeDpValueDatapoint value type, which can be boolean, number, or string.
export type DpValue = boolean | number | string;

Examples

Example

const dpState = group.getDpState();
console.log(dpState.switch_led);  // true