---
name: "SmartGroupModel.onDeviceInfoUpdated"
mode: "api"
versionRequirements:
  - { name: "@ray-js/panel-sdk", version: "1.5.0" }
title: "onDeviceInfoUpdated"
---

## SmartGroupModel.onDeviceInfoUpdated

> [VERSION] @ray-js/panel-sdk >= 1.5.0

> 💡 In a group-device environment, the native @ray-js/ray onDeviceInfoUpdated does not actually fire. To automatically adapt to both single-device and group-device environments, this callback is invoked in sync when the underlying onGroupInfoChange fires.

### Description

Listen for smart group device info change events

### Parameters

`(listener: Function)`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `listener` | `(data: DeviceInfoChanged) => number` | Yes | Event callback that receives parameters containing device info changes and related data |

### Return Value

None


### Referenced Types

##### `type` DeviceInfoChanged

Device info change event callback parameters

| Property | Type | Description |
| --- | --- | --- |
| `deviceId` | `string` | Device ID |
| `dps` | `DpState` | Changed DP data (may be empty) |

##### `type` DpState

Datapoint status object, where the key is the datapoint code and the value is the datapoint value.

```typescript
export type DpState = Record<string, DpValue>;
```

##### `type` DpValue

Datapoint value type, which can be boolean, number, or string.

```typescript
export type DpValue = boolean | number | string;
```


### Examples

#### Example

```typescript
const id = group.onDeviceInfoUpdated((data) => {
  console.log('Group info changed:', data);
});
// Unregister when needed
group.offDeviceInfoUpdated(id);
```
