更新时间:2023-12-18 06:17:48下载pdf
yarn add @tuya/tuya-panel-lamp-sdk
import { Utils } from '@tuya/tuya-panel-lamp-sdk';
const { isSupportBright } = Utils.SupportUtils;
| 方法 | 作用 | 参数 | 返回值类型 | 备注 |
|---|---|---|---|---|
| isGroupDevice | 是否为群组设备 | (isForce = false) | Boolean | isForce:是否不从缓存中判断 |
| isSupportBright | 是否支持白光亮度 | (isForce = false) | Boolean | isForce:是否不从缓存中判断 |
| isSupportTemp | 是否支持色温 | (isForce = false) | Boolean | isForce:是否不从缓存中判断 |
| isSupportColour | 是否支持彩光 | (isForce = false) | Boolean | isForce:是否不从缓存中判断 |
| isSupportScene | 是否支持场景 | (isForce = false) | Boolean | isForce:是否不从缓存中判断 |
| isSupportMusic | 是否支持 App 音乐 | (isForce = false) | Boolean | isForce:是否不从缓存中判断 |
| isSupportCountdown | 是否支持倒计时 | (isForce = false) | Boolean | isForce:是否不从缓存中判断 |
| isSupportRhythm | 是否支持生物节律 | (isForce = false) | Boolean | isForce:是否不从缓存中判断 |
| isSupportWhite | 是否支持彩光 | (isForce = false) | Boolean | isForce:是否不从缓存中判断 |
| isSupportWorkMode | 是否支持该工作模式 | (code: string) | Boolean | isForce:是否不从缓存中判断 |
| isSupportDp | 是否支持该 DP 点 | (dpCode: string, isForce = false) | Boolean | dpCode:DP 点名称 isForce:是否不从缓存中判断 |
| isZigbeeDevice | 是否支持 Zigbee 能力 | null | Boolean | |
| isSignMeshDivice | 是否支持 SigMesh 能力 | null | Boolean | |
| isWifiDivice | 是否支持 Wi-Fi 能力 | null | Boolean | |
| hasCapability | 是否拥有某种能力 | (id:number) | Boolean | id:设备能力位 |
capability:设备的能力类型
| 类型 | Wi-Fi | Bluetooth LE | Zigbee | Bluetooth Mesh | Beacon |
|---|---|---|---|---|---|
| 位 | 0 | 10 | 12 | 15 | 21 |
import { Utils } from '@tuya/tuya-panel-lamp-sdk';
Utils.SupportUtils.isGroupDevice(); // true/false
Utils.SupportUtils.isSupportBright(); // true/false
Utils.SupportUtils.isSupportTemp(); // true/false
Utils.SupportUtils.isSupportColour(); // true/false
Utils.SupportUtils.isSupportScene(); // true/false
Utils.SupportUtils.isSupportMusic(); // true/false
Utils.SupportUtils.isSupportCountdown(); // true/false
Utils.SupportUtils.isSupportRhythm(); // true/false
Utils.SupportUtils.isSupportWhite(); // true/false
/** 工作模式是否支持白光 */
Utils.SupportUtils.isSupportWorkMode('music'); // true/false
/** 是否支持彩光模式 */
Utils.SupportUtils.isSupportDp('color_data'); // true/false
Utils.SupportUtils.isZigbeeDevice(); // true/false
Utils.SupportUtils.isWifiDivice(); // true/false
/** 是否拥有 Wi-Fi 能力 */
Utils.SupportUtils.hasCapability(0); // true/false
该内容对您有帮助吗?
是意见反馈该内容对您有帮助吗?
是意见反馈