General Category Capabilities

General category capabilities consist of two parts: "Built-in Capabilities of Basic Library" and "Panel SDK Development Kit", aiming to improve the development efficiency of panel mini programs through standardized interaction and refined development models.

Capability Matrix

DimensionImplementation EntityModule NameDescriptionDocumentation
Standard Core CapabilitiesBasic LibraryPanel Environment InitializationAutomatically handles offline pop-ups, Bluetooth connection, OTA upgrade, fault reminders, etc.Overview and Initialization
Connectivity and OfflineGuidance for offline masks and automatic Bluetooth reconnection behavior.Connectivity and Offline Logic
OTA UpgradeFirmware detection, mandatory/reminder upgrade logic.OTA Upgrade Description
Panel Development KitPanel SDKSmart Device Model (SDM)OOP-based smart device programming model, simplifying data management and control logic.Smart Device Model
Smart Group Model (SGM)OOP-based smart group programming model.Smart Group Model
Multi-Device ManagementFreely manage multiple independent device instances within a single miniapp, supporting batch status reading and command issuing.Multi-Device Management
Panel Multi-languagePanel-exclusive internationalization adaptation solution, supporting cloud entry synchronization.Multi-language Configuration
Function Point Parsing SetParsing and conversion tools for common function point protocols.Function Point Parsing Set
Hooks & UtilsCommon React Hooks and utility functions refined from business logic.Hooks

1. Built-in Capabilities of Basic Library

Built-in capabilities of the basic library are the standard interaction specification implementation of the Tuya Panel MiniApp. It is directly driven by the basic library, requiring no additional dependencies (DeviceKit needs to be introduced), mainly solving common interaction issues in the device lifecycle (e.g., how to remind users of device offline, how to guide firmware upgrades).

  • Features: Ready to use, unified interaction, closed and secure logic.
  • Core Entry: initPanelEnvironment

2. Panel SDK Development Kit

Panel SDK is an extension kit designed to enhance the programming experience of developers. It provides a set of programming models more in line with modern front-end development habits (OOP/Hooks) through the abstract encapsulation of device DPs, groups, multi-languages, and other underlying data.

  • Features: Significant efficiency improvement, flexible expansion, on-demand introduction.
  • Installation Dependency:

Installation

$ yarn add @ray-js/panel-sdk
# or
$ npm install @ray-js/panel-sdk

Use

// Import standard environment initialization (Basic Library capability)
import { initPanelEnvironment } from '@ray-js/ray';

// Import Panel SDK tools (SDK capability)
import { useProps, useActions } from '@ray-js/panel-sdk';