Last Updated on : 2024-06-24 03:53:04download
This topic describes the specific functions of laser robot vacuum templates and how to use them. For more resources, visit the GitHub repository.
This project depends on TYSdk.mobile.mobileInfo.appRnVersion
v5.28 and later. If your app version is too early, go to Tuya Panel-RN to download the latest version.
This laser robot vacuum template project is built on React Native 0.59 and supports the following functions:
This section only describes the directories related to the scaffold. For more information about the general directory structure, see RN 0.59 TS.
├── src
│ ├── api // Place a series of cloud APIs used in the project.
│ ├── components // Place reusable functional components used in the project.
│ ├── composeLayout.tsx // Encapsulate `device events` and `device information` required in the panel.
│ ├── config // Place some configuration files that are frequently used in the panel.
│ ├── pages // Place page-level components of the project.
│ ├── protocol // Place data parsing protocol including maps, paths, and virtual information.
│ ├── i18n // Place configuration files for multiple languages.
│ ├── main.tsx // Project entry files that are inherited from `NavigatorLayout`. Rewrite the `hookRoute` method to pass in some necessary configurations, such as background, topbar, and more. Rewrite the `renderScene` method to control routing jump.
│ ├── store // Place some codes related to `redux`.
│ ├── res // Place local resources, such as pictures and SVG path.
│ └── utils // Place some common tools and methods that are used in the panel.
Enter the panel and send a request: get_both
to get and parse map data, route data, and virtual information data, and then display them on the panel homepage.
Tap SmartClean to operate the robot vacuum to start or pause cleaning.
Tap Chargego to operate the robot vacuum to start or pause charging.
Tap PoseClean, select a Position on the map, and tap Confirm to operate the robot vacuum to clean the area.
Tap Select room and select an area on the map, and tap Confirm to clean the selected area.
Tap ZoneClean to add a zone on the map, and tap Confirm to clean the zone.
Tap Forbbiden Edit to add an Area and a Wall on the map.
Tap Room edit to edit the map.
On the Room edit page, you can perform the following operations:
Tap More to enter the Settings page.
On the Settings page, you can perform the following operations:
This section only describes the required DPs of the robot vacuum. For more information about the optional DPs, see the corresponding product details.
Name | Value |
---|---|
id | 1 |
code | switch_go |
type | bool |
mode | Send and report |
value | true or false |
description |
|
Name | Value |
---|---|
id | 2 |
code | pause |
type | bool |
mode | Send and report |
value | true or false |
description |
|
Name | Value |
---|---|
id | 3 |
code | switch_charge |
type | bool |
mode | Send and report |
value | true or false |
description |
|
Name | Value |
---|---|
id | 4 |
code | mode |
type | Enum |
mode | Send and report |
value | Enum value: smart, chargego, zone, pose, part, and select_room |
description | The default value. It cannot be modified or deleted. Otherwise, the logic of the control panel will be affected:
|
Name | Value |
---|---|
id | 5 |
code | status |
type | Enum |
mode | Report only |
value | Enum value: standby, smart, zone_clean, part_clean, cleaning, paused, goto_pos, pos_arrived, pos_unarrive, goto_charge, charging, charge_done, sleep, and select_room |
description | The default value. It cannot be modified or deleted. Otherwise, the logic of the control panel will be affected:
Note: Other status values can be added, and the status value should be English words in lowercase. If a fault status is required, set a value as |
Name | Value |
---|---|
id | 14 |
code | path_data |
type | Raw type |
mode | Send and report |
description | For more information about the related data protocol and logic, see the map protocol files of the robot vacuum in the SDK. |
Name | Value |
---|---|
id | 15 |
code | command_trans |
type | Raw type |
mode | Send and report |
description | For more information about the related data protocol and logic, see the map protocol files of the robot vacuum in the SDK. |
Name | Value |
---|---|
id | 16 |
code | request |
type | Enum |
mode | Send and report |
value | Enum value: get_map, get_path, and get_both |
description | For more information about the related data protocol and logic, see the map protocol files of the robot vacuum in the SDK. |
Name | Value |
---|---|
id | 28 |
code | fault |
mode | Send and report |
value | Fault value: edge_sweep, middle_sweep, left_wheel, right_wheel, garbage_box, land_check, collision |
description | The default value. It cannot be modified or deleted. Otherwise, the logic of the control panel will be affected:
Note: Other status values can be added, and the status value should be English words in lowercase. If a fault status is required, set a value as |
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback