Last Updated on : 2022-06-28 13:28:52download
yarn add @tuya-rn/tuya-native-lamp-elements@2.0.5;
import { SupportUtils } from '@tuya-rn/tuya-native-lamp-elements/lib/utils';
Method | Feature | Parameter | Value type | Remarks |
---|---|---|---|---|
isGroupDevice | Specifies whether a group device is used. | (isForce = false) | Boolean | isForce : specifies whether the value is not obtained from the cache. |
isSupportBright | Specifies whether to support the white color brightness. | (isForce = false) | Boolean | isForce : specifies whether the value is not obtained from the cache. |
isSupportTemp | Specifies whether to support color temperature. | (isForce = false) | Boolean | isForce : specifies whether the value is not obtained from the cache. |
isSupportColour | Specifies whether to support the colored mode. | (isForce = false) | Boolean | isForce : specifies whether the value is not obtained from the cache. |
isSupportScene | Specifies whether to support smart scenes. | (isForce = false) | Boolean | isForce : specifies whether the value is not obtained from the cache. |
isSupportMusic | Specifies whether to support app music. | (isForce = false) | Boolean | isForce : specifies whether the value is not obtained from the cache. |
isSupportCountdown | Specifies whether to support the countdown. | (isForce = false) | Boolean | isForce : specifies whether the value is not obtained from the cache. |
isSupportRhythm | Specifies whether to support biorhythm. | (isForce = false) | Boolean | isForce : specifies whether the value is not obtained from the cache. |
isSupportWhite | Specifies whether to support the colored mode. | (isForce = false) | Boolean | isForce : specifies whether the value is not obtained from the cache. |
isSupportWorkMode | Specifies whether to support the specified work mode. | (code: string) | Boolean | isForce : specifies whether the value is not obtained from the cache. |
isSupportDp | Specifies whether to support the specified DP. | (dpCode: string, isForce = false) | Boolean | dpCode : the data point (DP) name. isForce : specifies whether the value is not obtained from the cache. |
isZigbeeDevice | Specifies whether to support Zigbee capabilities. | null | Boolean | |
isSignMeshDivice | Specifies whether to support Bluetooth mesh capabilities. | null | Boolean | |
isWifiDivice | Specifies whether to support Wi-Fi capabilities. | null | Boolean | |
hasCapability | Specifies whether a certain capability is supported. | (id:number) | Boolean | id : the device capability bit. |
capability
: the capability type of the device.
Type | Wi-Fi | Bluetooth LE | Zigbee | Bluetooth mesh | Beacon |
---|---|---|---|---|---|
Number of binary digits | 0 | 10 | 12 | 15 | 21 |
import { SupportUtils } from '@tuya-rn/tuya-native-lamp-elements/lib/utils';
SupportUtils.isGroupDevice(); // true/false
SupportUtils.isSupportBright(); // true/false
SupportUtils.isSupportTemp(); // true/false
SupportUtils.isSupportColour(); // true/false
SupportUtils.isSupportScene(); // true/false
SupportUtils.isSupportMusic(); // true/false
SupportUtils.isSupportCountdown(); // true/false
SupportUtils.isSupportRhythm(); // true/false
SupportUtils.isSupportWhite(); // true/false
/** Specifies whether to support the white light mode.*/
SupportUtils.isSupportWorkMode('music'); // true/false
/** Specifies whether to support the colored mode. */
SupportUtils.isSupportDp('color_data'); // true/false
SupportUtils.isZigbeeDevice(); // true/false
SupportUtils.isWifiDivice(); // true/false
/** Specifies whether the Wi-Fi capability is enabled. */
SupportUtils.hasCapability(0); // true/false
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback