getPetBehaviorStatistics(data: GetPetBehaviorStatistics)

版本要求:
@ray-js/ray≥1.6.27

描述

获取宠物行为指标统计

参数

参数类型必填说明
是请求参数:可选设备、宠物、日期范围;dateType、timeAggrType、indicatorCode 等聚合条件

返回值

类型:Promise<PetBehaviorStatistics>
Promise,resolve 值为统计项(datetime、value)

引用对象

typePetBehaviorStatistics
属性类型描述
datetimestring统计日期
valuenumber指标值

示例代码

请求示例

import { getPetBehaviorStatistics } from '@ray-js/ray';

getPetBehaviorStatistics({
  devId: 'vdevo******',
  petId: 1,
  beginDate: '2025072500',
  endDate: '2025072523',
  dateType: 'hour',
  timeAggrType: 'NUM',
  indicatorCode: 'defecation',
})
  .then((res) => {
    console.log(res);
  })
  .catch(console.error);

返回示例

{
  "datetime": "2025072500",
  "value": 3
}