---
name: "getDeviceStatus"
mode: "api"
versionRequirements:
  - { name: "@ray-js/lock-sdk", version: "1.0.0" }
title: "getDeviceStatus - Get device status information."
summary: "Get device status information."
---

## getDeviceStatus

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

### Description

Read the device's overall status (online/sleep, etc.).

### Parameters

None


### Return Value

Type: `DeviceStatus`

Device status object

##### DeviceStatus

| Property | Type | Description |
| --- | --- | --- |
| `type` | `"offline" \| "online" \| "sleep"` | Overall status: Online / Offline / Sleep |
| `connectEnable` | `boolean` | Whether users are allowed to initiate a connection manually (e.g., BLE) |
| `onlineTypes` | `"local" \| "cloud" \| "ble" \| "localMatter" \| "yuChannel" \| "unknown"[]` | Online channel list (bit semantics expanded by the platform into an array) local Local network online cloud Cloud online ble Bluetooth online localMatter Matter local network online yuChannel Cloud bridge online unknown Unknown |
| `sleepPeriod` | `Object` | Sleep window (sleep only) |
| `isWifiActive` | `boolean` | Whether the Wi-Fi module is powered on and running |
| `isWifiMatter` | `boolean` | Whether Wi-Fi supports the Matter solution |
| `isActiveThread` | `boolean` | Whether the Thread channel is activated |
| `isShareThread` | `boolean` | Whether it is a shared Thread device |

##### DeviceStatus.sleepPeriod properties

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `start` | `number` | Yes | - | Start |
| `end` | `number` | Yes | - | End |


### Examples

```ts
import { getDeviceStatus } from '@ray-js/lock-sdk';
const status = getDeviceStatus();
```
