getStatisticsConfig(data: IDevId)

版本要求:
@tuya-miniapp/cloud-api≥1.0.5

描述

获取统计配置,获取开通智能计量的 DP 点及配置。

参数

参数类型必填说明
是请求体

返回值

类型:Promise<IStatisticsConfig[]>
IStatisticsConfig[](字段含义见类型定义与 minituya 返回值表)

示例代码

请求示例

import { getStatisticsConfig } from '@tuya-miniapp/cloud-api';

getStatisticsConfig({
  devId: 'vdevo166789063330437',
})
  .then((response) => {
    console.log(response);
  })
  .catch();

返回示例

[
  {
    "storageDuration": 365,
    "productId": "lcrxzqjqojafatrv",
    "dpId": 18,
    "statisticInterval": 1,
    "algorithmType": "avg"
  },
  {
    "storageDuration": 365,
    "productId": "lcrxzqjqojafatrv",
    "dpId": 1,
    "statisticInterval": 1,
    "algorithmType": "count"
  },
  {
    "storageDuration": 7,
    "productId": "lcrxzqjqojafatrv",
    "dpId": 1,
    "statisticInterval": 2,
    "algorithmType": "count"
  }
]