getCleaningRecords(params: GetCleaningRecordsParams)

Requires:
@ray-js/ray≥1.5.36Base library≥2.21.0

Description

Get the cleaning record list

Parameters

ParameterTypeRequiredDescription
YesQuery parameters including Device ID, time range, and pagination info

Return Value

Type: Promise<GetCleaningRecordsResponse>
Promise that resolves with the cleaning record list and total count

Examples

import React from 'react';
import { Button, getCleaningRecords } from '@ray-js/ray';

export default function Demo() {
  const handleFetch = async () => {
    const result = await getCleaningRecords({
      devId: 'your-device-id',
      startTime: '1700000000',
      endTime: '1700086400',
      offset: 0,
      limit: 10,
    });
    console.log(result.datas, result.totalCount);
  };
  return <Button onClick={handleFetch}>Get cleaning records</Button>;
}

deleteCleaningRecord(params: DeleteCleaningRecordParams)

Requires:
@ray-js/ray≥1.5.36Base library≥2.21.0

Description

Delete cleaning records

Parameters

ParameterTypeRequiredDescription
YesContains Device ID and an array of record IDs to delete

Return Value

Type: Promise<boolean>
Promise that resolves to a boolean indicating whether deletion succeeded

Examples

import React from 'react';
import { Button, deleteCleaningRecord } from '@ray-js/ray';

export default function Demo() {
  const handleDelete = async () => {
    const success = await deleteCleaningRecord({
      devId: 'your-device-id',
      fileIds: [1001, 1002],
    });
    console.log('Delete result:', success);
  };
  return <Button onClick={handleDelete}>Delete records</Button>;
}

getGyroCleanRecords(params: GetGyroCleanRecordsParams)

Requires:
@ray-js/ray≥1.7.14Base library≥2.29.0

Description

Get the cleaning record list for a gyroscope-based robot vacuum

Parameters

ParameterTypeRequiredDescription
YesQuery parameters including Device ID, a set of DPs, and pagination info

Return Value

Type: Promise<GetGyroCleanRecordsResponse>
Promise that resolves with the gyroscope-based vacuum's cleaning record list and total count

Examples

import React from 'react';
import { Button, getGyroCleanRecords } from '@ray-js/ray';

export default function Demo() {
  const handleFetch = async () => {
    const result = await getGyroCleanRecords({
      devId: 'your-device-id',
      dpIds: [101, 102],
      offset: 0,
      limit: 10,
    });
    console.log(result.datas, result.totalCount);
  };
  return <Button onClick={handleFetch}>Get gyroscope records</Button>;
}

getGyroCleanRecordDetail(params: GetGyroCleanRecordDetailParams)

Requires:
@ray-js/ray≥1.7.14Base library≥2.29.0

Description

Get cleaning record details for a gyroscope-based robot vacuum

Parameters

ParameterTypeRequiredDescription
YesQuery parameters including Device ID, sub-record ID, and pagination info

Return Value

Type: Promise<GetGyroCleanRecordDetailResponse>
Promise that resolves with the cleaning record's map data and pagination info

Examples

import React from 'react';
import { Button, getGyroCleanRecordDetail } from '@ray-js/ray';

export default function Demo() {
  const handleFetch = async () => {
    const detail = await getGyroCleanRecordDetail({
      devId: 'your-device-id',
      subRecordId: 12345,
      start: 0,
      size: 100,
    });
    console.log(detail.dataList, detail.hasNext);
  };
  return <Button onClick={handleFetch}>Get record details</Button>;
}