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

## SmartDeviceModel.getNetwork

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

### Description

Get the network status of the smart device’s environment

### Parameters

None


### Return Value

Type: `NetworkState`

Network status object containing isConnected, networkType, signalStrength

**`interface` NetworkState**

| Property | Type | Description |
| --- | --- | --- |
| `isConnected` | `boolean` | Whether connected |
| `networkType` | `string` | Network type: WIFI \| 5G \| 4G \| 3G \| 2G \| GPRS \| UNKNOWN \| NONE |
| `signalStrength` | `number` | Signal strength, unit: dBm |

### Referenced Types

##### `interface` NetworkState

| Property | Type | Description |
| --- | --- | --- |
| `isConnected` | `boolean` | Whether connected |
| `networkType` | `string` | Network type: WIFI \| 5G \| 4G \| 3G \| 2G \| GPRS \| UNKNOWN \| NONE |
| `signalStrength` | `number` | Signal strength, unit: dBm |


### Examples

#### Example

```typescript
const network = device.getNetwork();
console.log(network.isConnected);  // true
console.log(network.networkType);  // 'WIFI'
```
