SmartGroupModel.publishDps(data: Record<string, DpValue>, options?: SendDpOption)

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

Description

Batch control smart group DPs

Parameters

ParameterTypeRequiredDescription
dataRecord<string, DpValue>YesKey-value pairs to send. Keys are DP Code; value types are inferred from the Schema: bool -> boolean, value -> number, enum -> property.range literal union, bitmap -> number, string/raw -> string
NoSend options

Return Value

Type: Promise<boolean>
Whether the send succeeded

Referenced Types

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

Examples

Example

// Control on/off for all devices in the group
await group.publishDps({ switch_led: true });
// Supports batch sending of multiple DPs
await group.publishDps({ switch_led: true, brightness: 800 });