getDeviceStatus()

Requires:
@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
PropertyTypeDescription
type"offline" | "online" | "sleep"Overall status: Online / Offline / Sleep
connectEnablebooleanWhether 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
Sleep window (sleep only)
isWifiActivebooleanWhether the Wi-Fi module is powered on and running
isWifiMatterbooleanWhether Wi-Fi supports the Matter solution
isActiveThreadbooleanWhether the Thread channel is activated
isShareThreadbooleanWhether it is a shared Thread device

Valid Values

return.type
ValueDescriptionSince
offline--
online--
sleep--
return.onlineTypes
ValueDescriptionSince
local--
cloud--
ble--
localMatter--
yuChannel--
unknown--

Examples

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