Last Updated on : 2021-09-10 08:43:53download
This topic introduces the interfaces for querying device data in the sweeper panel SDK.
Query the latest streaming service record details data.
| Parameter | Data type | Description | Required? |
|---|---|---|---|
| opt | IGetGyroMapLatestMediaOpts | see the IGetGyroMapLatestMediaOpts | No |
IGetGyroMapLatestMediaOpts
| Parameter | Data type | Description | Required? |
|---|---|---|---|
| offset | String | The position to start the query, refers to the result of the nextOffset of the last query, if the first query is not required | No |
| limit | Number | Maximum number of map data in one query. Default value: 500. | No |
| Parameter | Data type | Description |
|---|---|---|
| response | IGyroMapMediaExport | see the IGyroMapMediaExport |
IGyroMapMediaExport
| Parameter | Data type | Description |
|---|---|---|
| dataList | String[] | Map data |
| subRecordId | Number | Streaming service ID |
| nextOffset | String | Where to start searching on the next page |
import { GyroDataApi } from '@tuya/tuya-panel-robot-sdk'
GyroDataApi.getGyroMapLatestMedia({
offset: '',
limit: 500
}).then((response) => {
console.log(response)
}).catch()
{
dataList: [],
subRecordId: 0,
nextOffset: '',
}
Query the detailed data of a streaming service record.
| Parameter | Data type | Description | Required? |
|---|---|---|---|
| opt | IGetGyroMapHistoryMediaOpts | see the IGetGyroMapHistoryMediaOpts | No |
IGetGyroMapHistoryMediaOpts
| Parameter | Data type | Description | Required? |
|---|---|---|---|
| offset | String | The position to start the query, refers to the result of the nextOffset of the last query, if the first query is not required | No |
| limit | Number | Maximum number of map data in one query. Default value: 500. | No |
| subRecordId | String | Stream Service Record Id | Yes |
| Parameter | Data type | Description |
|---|---|---|
| response | IGyroMapMediaExport | see the IGyroMapMediaExport |
IGyroMapMediaExport
| Parameter | Data type | Description |
|---|---|---|
| dataList | String[] | Map data |
| subRecordId | Number | Streaming service ID |
| nextOffset | String | Where to start searching on the next page |
import { GyroDataApi } from '@tuya/tuya-panel-robot-sdk'
GyroDataApi.getGyroMapHistoryMediaBySubRecordId({
subRecordId: '1',
offset: '',
limit: 500
}).then((value) => {
console.log(value)
}).catch()
{
dataList: [],
subRecordId: 0,
nextOffset: '',
}
Query the cleaning record list.
| Parameter | Data type | Description | Required? |
|---|---|---|---|
| opt | IGetGyroHistoryListOpts | see the IGetGyroHistoryListOpts | No |
IGetGyroHistoryListOpts
| Parameter | Data type | Description | Required? |
|---|---|---|---|
| cleanRecordCode | String | Clean up records dpCode. Default value: clean_record. | No |
| page | Number | Query the number of pages. Default value: 0. | No |
| pageLimit | Number | Display the most data per page. Default value: 10. | No |
| startTime | Number | Start time unix timestamp | No |
| endTime | Number | End time unix timestamp | No |
| Parameter | Data type | Description |
|---|---|---|
| response | IRecordExportList | see the IRecordExportList |
IRecordExportList
| Parameter | Data type | Description |
|---|---|---|
| dataList | IRecordExportData[] | Clean the record list, see the IRecordExportData |
| hasNext | Boolean | Is there a next page |
IRecordExportData
| Parameter | Data type | Description |
|---|---|---|
| id | String | The cleaning record ID |
| value | String | The cleaning record content |
| timestamp | Number | Cloud timestamp |
import { GyroDataApi } from '@tuya/tuya-panel-robot-sdk'
GyroDataApi.getGyroMapHistoryList({
cleanRecordCode: 'clean_record',
page: 1,
pageLimit: 10,
}).then((value) => {
console.log(value)
}).catch()
{
dataList:[{
id: '',
value: '',
timestamp: 0,
}],
hasNext: false
}
Delete cleaning records.
| Parameter | Data type | Description | Required? |
|---|---|---|---|
| ids | String[] | cleaning records Id | No |
| Parameter | Data type | Description |
|---|---|---|
| response | Boolean | Is the deletion successful |
import { GyroDataApi } from '@tuya/tuya-panel-robot-sdk'
GyroDataApi.deleteGyroMapHistoryByIds(['1']).then((value) => {
console.log(value)
}).catch()
true
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback