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

## SmartDeviceModel.getDpState

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

### Description

Get smart device DP status

### Parameters

None


### Return Value

Type: `DpState`

Full DP state object: keys are DP codes, values are DP values, which may be boolean, number, or string

**`type` DpState**

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

### Referenced Types

##### `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 dpState = device.getDpState();
console.log(dpState.switch_led);  // true (boolean, corresponds to bool DP)
console.log(dpState.brightness);  // 500 (number, corresponds to value DP)
console.log(dpState.work_mode);   // 'white' (string, corresponds to enum DP)
```
