SmartGroupModel.onDpDataChange(listener: Function)
Requires:
@ray-js/panel-sdk≥1.5.0
Description
Listen for DP change events in group devices
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
listener | (data: GroupDpsChanged) => number | Yes | Event callback that receives parameters including groupId, dps (mapping of changed DP IDs to values), etc. |
Return Value
Type: number
Listener ID, used to cancel via offDpDataChange
Referenced Types
type
GroupDpsChangedDP change event callback parameters (group device)| Property | Type | Required | Description |
|---|---|---|---|
groupId | string | Yes | Group ID |
| Yes | Changed DP data, where the key is the DP ID and the value is the DP value |
type
DpStateDatapoint status object, where the key is the datapoint code and the value is the datapoint value.type
DpValueDatapoint value type, which can be boolean, number, or string.