SmartDeviceModel.onDeviceInfoUpdated(listener: Function)
Requires:
@ray-js/panel-sdk≥1.0.0
Description
Listen for smart device info change events (including changes to device name, DP names, etc.)
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
listener | (data: DeviceInfoChanged) => number | Yes | Event callback that receives parameters containing deviceId, changed data, etc. |
Return Value
Type: number
Listener ID used to unsubscribe via offDeviceInfoUpdated
Referenced Types
type
DeviceInfoChangedDevice info change event callback parameters| Property | Type | Required | Description |
|---|---|---|---|
deviceId | string | Yes | Device ID |
| No | Changed DP data (may be empty) |
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.