---
name: "SmartDeviceModel.onNetworkStatusChange"
mode: "api"
versionRequirements:
  - { name: "@ray-js/panel-sdk", version: "1.0.0" }
---

## SmartDeviceModel.onNetworkStatusChange

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

### Description

Listen for network status change events

### Parameters

`(listener: Function)`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `listener` | `(data: NetworkStatusChanged) => number` | Yes | Event callback that receives parameters including isConnected, networkType, etc. |

### Return Value

None


### Referenced Types

##### `type` NetworkStatusChanged

Network status change event callback parameters

| Property | Type | Description |
| --- | --- | --- |
| `isConnected` | `boolean` | Whether a network connection is available |
| `networkType` | `string` | Network type |


### Examples

#### Example

```typescript
const id = device.onNetworkStatusChange((data) => {
  console.log('Network status changed:', data.isConnected, data.networkType);
});
// Unsubscribe
device.offNetworkStatusChange(id);
```
