Usage

Device SupportGroup Support
Info

Current support capability sdk abstracts the following capabilities:

  • Determine the device type
  • Check whether dp is supported
  • Other abilities support judgment

SmartSupportAbility(options: Function)

Requires:
@ray-js/panel-sdk≥1.10.0

Description

Device capability check to determine supported DPs and protocol types

Parameters

ParameterTypeRequiredDescription
options{ initDevInfo?: (devInfo) => void }NoDevice capability check configuration

Return Value

Type: SmartSupportAbility
SmartSupportAbility instance

Methods

MethodDescription
isSupportDpCheck whether a given DP code is supported by the device
isInGatewayDetermine whether the device has been added to a gateway
isGroupDeviceDetermine whether the current device is a group device
isSupportBrightDetermine whether the device supports the white brightness DP
isSupportTempDetermine whether the device supports the color temperature DP
isSupportColourDetermine whether the device supports the color light DP
isSupportCloudTimerDetermine whether the device supports cloud timers
isWifiDeviceDetermine whether it is a WiFi device
isGprsDeviceDetermine whether it is a GPRS device
isBluetoothDeviceDetermine whether it is a Bluetooth device
isBleMeshDeviceDetermine whether it is a BLE Mesh device
isZigbeeDeviceDetermine whether it is a Zigbee device
isSigMeshDeviceDetermine whether it is a SIG Mesh device
isBleDeviceDetermine whether it is a Bluetooth-class device (including Bluetooth, BLE Mesh, SIG Mesh)
isCat1DeviceDetermine whether it is a Cat.1 device
isBeaconDeviceDetermine whether it is a Beacon device
isLteCat4DeviceDetermine whether it is an LTE Cat.4 device
isLteCat10DeviceDetermine whether it is an LTE Cat.10 device
isLteCatMDeviceDetermine whether it is an LTE Cat.M device
isThreadDeviceDetermine whether it is a Thread device
isMatterDeviceDetermine whether it is a Matter device
isTuyaMatterDeviceDetermine whether it is a Tuya Matter device
isTripartiteMatterDetermine whether it is a third-party Matter device
isSupportMatterWhiteDetermine whether the device supports Matter white light

Examples

Example

// Usage 1 (recommended)
import { SmartDeviceModel, SmartSupportAbility } from '@ray-js/panel-sdk';

const sdm = new SmartDeviceModel({ abilities: [new SmartSupportAbility()] });
const isSupportxxx = sdm.support.xxx()

// Usage 2 (not recommended)
const support = new SmartSupportAbility({
  initDevInfo: (devInfo) => {
    return {
      ...devInfo,
      isMatter: true,
    };
  },
});

await support.init({ deviceId: '1234567890' });