---
name: "useSupport"
mode: "api"
versionRequirements:
  - { name: "@ray-js/panel-sdk", version: "1.10.0" }
title: "useSupport - Implemented based on sdm and support-ability, a hooks-based device support status"
summary: "useSupport is a React Hook provided by @ray-js/panel-sdk, implemented based on sdm and SmartSupportAbility. It returns a support instance that can directly call device capability check methods (e.g. isSupportCloudTimer, isSupportDp, isSupportBright, etc.). Supports both single devices and groups. SdmProvider must be mounted and SmartSupportAbility must be integrated before use."
questions:
  - "What methods can the SmartSupportAbility instance returned by useSupport call (e.g. isSupportCloudTimer)?"
  - "useSupport supports both single devices and groups. What are the usage differences?"
  - "Before using useSupport, you need to configure and integrate SmartSupportAbility. Where is it configured?"
  - "What is the role of the TypeScript generic T extends DpSchema[] in useSupport?"
  - "How to use useSupport in a component to check whether the device supports cloud timer functionality?"
  - "useSupport's API signature takes no arguments. Where can I find the detailed method list of the return value (SmartSupportAbility API)?"
  - "Before using useSupport, you need to mount SdmProvider and integrate SmartSupportAbility. Are both required?"
  - "useSupport is implemented based on sdm and support-ability. What is the difference from using the SmartSupportAbility instance directly?"
  - "How to quickly integrate useSupport in a new project based on the public-sdm example project?"
  - "Can the support instance returned by useSupport call methods like isSupportDp, isSupportBright, isSupportTemp?"
---

<div style={{ display: 'flex', gap: '8px', marginBottom: '16px' }}>
  <span style={{ backgroundColor: '#52c41a', color: 'white', padding: '2px 8px', borderRadius: '4px', fontSize: '12px' }}>Device Support</span>
  <span style={{ backgroundColor: '#52c41a', color: 'white', padding: '2px 8px', borderRadius: '4px', fontSize: '12px' }}>Group Support</span>
</div>

## useSupport

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

> 💡 Before use, both conditions must be met:
> 1. SdmProvider is mounted in the project
> 2. SmartSupportAbility is configured during SmartDeviceModel initialization

### Description

Get a device capability detection instance to determine the features and protocols the device supports

### Parameters

None


### Return Value

Type: `SupportAbilityMethods`

SmartSupportAbility instance object

**`interface` SupportAbilityMethods**

| Property | Type | Description |
| --- | --- | --- |
| `isSupportDp` | `(dpCode: string, isForce: boolean) => boolean` | Check whether the device supports the specified function point |
| `isSupportBright` | `(isForce: boolean) => boolean` | Check whether the device supports white-light brightness |
| `isSupportTemp` | `(isForce: boolean) => boolean` | Check whether the device supports color temperature |
| `isSupportColour` | `(isForce: boolean) => boolean` | Check whether the device supports colored light |
| `isSupportCloudTimer` | `() => boolean` | Check whether the device supports cloud-based scheduling |
| `isSupportMatterWhite` | `(force: boolean) => boolean` | Check whether Matter white light is supported |
| `isInGateway` | `() => boolean` | Check whether the device has been added to a gateway |
| `isGroupDevice` | `() => boolean` | Check whether the current device is a group device |
| `hasCapability` | `(id: number) => boolean` | Check whether the device has the specified protocol capability (the input is a DeviceCapability enum value) |
| `isWifiDevice` | `() => boolean` | Check whether it is a Wi-Fi device |
| `isGprsDevice` | `() => boolean` | Determine whether it is a GPRS device |
| `isBluetoothDevice` | `() => boolean` | Determine whether it is a Bluetooth device |
| `isBleMeshDevice` | `() => boolean` | Determine whether it is a BLE Mesh device |
| `isZigbeeDevice` | `() => boolean` | Determine whether it is a Zigbee device |
| `isSigMeshDevice` | `() => boolean` | Determine whether it is a SIG Mesh device |
| `isBleDevice` | `() => boolean` | Determine whether it is a Bluetooth‑type device (including Bluetooth / BLE Mesh / SIG Mesh) |
| `isCat1Device` | `() => boolean` | Determine whether it is a Cat.1 device |
| `isBeaconDevice` | `() => boolean` | Determine whether it is a Beacon device |
| `isLteCat4Device` | `() => boolean` | Determine whether it is an LTE Cat.4 device |
| `isLteCat10Device` | `() => boolean` | Determine whether it is an LTE Cat.10 device |
| `isLteCatMDevice` | `() => boolean` | Determine whether it is an LTE Cat.M device |
| `isThreadDevice` | `() => boolean` | Determine whether it is a Thread device |
| `isMatterDevice` | `() => boolean` | Determine whether it is a Matter device (including Tuya Matter and third‑party Matter) |
| `isTuyaMatterDevice` | `() => boolean` | Determine whether it is a Tuya Matter device (excluding third‑party Matter) |
| `isTripartiteMatter` | `() => boolean` | Check whether it is a third-party Matter device |

### Referenced Types

##### `interface` SupportAbilityMethods

| Property | Type | Description |
| --- | --- | --- |
| `isSupportDp` | `(dpCode: string, isForce: boolean) => boolean` | Check whether the device supports the specified function point |
| `isSupportBright` | `(isForce: boolean) => boolean` | Check whether the device supports white-light brightness |
| `isSupportTemp` | `(isForce: boolean) => boolean` | Check whether the device supports color temperature |
| `isSupportColour` | `(isForce: boolean) => boolean` | Check whether the device supports colored light |
| `isSupportCloudTimer` | `() => boolean` | Check whether the device supports cloud-based scheduling |
| `isSupportMatterWhite` | `(force: boolean) => boolean` | Check whether Matter white light is supported |
| `isInGateway` | `() => boolean` | Check whether the device has been added to a gateway |
| `isGroupDevice` | `() => boolean` | Check whether the current device is a group device |
| `hasCapability` | `(id: number) => boolean` | Check whether the device has the specified protocol capability (the input is a DeviceCapability enum value) |
| `isWifiDevice` | `() => boolean` | Check whether it is a Wi-Fi device |
| `isGprsDevice` | `() => boolean` | Determine whether it is a GPRS device |
| `isBluetoothDevice` | `() => boolean` | Determine whether it is a Bluetooth device |
| `isBleMeshDevice` | `() => boolean` | Determine whether it is a BLE Mesh device |
| `isZigbeeDevice` | `() => boolean` | Determine whether it is a Zigbee device |
| `isSigMeshDevice` | `() => boolean` | Determine whether it is a SIG Mesh device |
| `isBleDevice` | `() => boolean` | Determine whether it is a Bluetooth‑type device (including Bluetooth / BLE Mesh / SIG Mesh) |
| `isCat1Device` | `() => boolean` | Determine whether it is a Cat.1 device |
| `isBeaconDevice` | `() => boolean` | Determine whether it is a Beacon device |
| `isLteCat4Device` | `() => boolean` | Determine whether it is an LTE Cat.4 device |
| `isLteCat10Device` | `() => boolean` | Determine whether it is an LTE Cat.10 device |
| `isLteCatMDevice` | `() => boolean` | Determine whether it is an LTE Cat.M device |
| `isThreadDevice` | `() => boolean` | Determine whether it is a Thread device |
| `isMatterDevice` | `() => boolean` | Determine whether it is a Matter device (including Tuya Matter and third‑party Matter) |
| `isTuyaMatterDevice` | `() => boolean` | Determine whether it is a Tuya Matter device (excluding third‑party Matter) |
| `isTripartiteMatter` | `() => boolean` | Check whether it is a third-party Matter device |


### Examples

#### Example

```tsx
import { useSupport } from '@ray-js/panel-sdk';

function SupportPage() {
  const support = useSupport();
  return (
    <View>
      <Text>{support.isSupportCloudTimer() ? 'Supports cloud timer' : 'Does not support cloud timer'}</Text>
      <Text>{support.isSupportDp('switch_led') ? 'Switch available' : 'Switch unavailable'}</Text>
    </View>
  );
}
```
