Clocks and reminders
Use the echolink module in @tuya-miniapp/cloud-api to manage clocks and reminders on smart speaker devices.
Prerequisites
- Use a version of
@tuya-miniapp/cloud-apithat includes the following APIs. See each API page for its minimum version. - The user must be logged in and have access to the target device.
- The miniapp must be authorized to use the Smart Speaker Clock and Reminder Capability (智能音箱闹钟与提醒能力).
APIs
Workflow
- Call
getEcholinkClockListto query clocks, orgetEcholinkAlarmListto query reminders. Records are in thedatafield of the returned object. - Call
addEcholinkClockto add a clock. It returns a boolean; query the list again to obtain the clock ID. - Use the
timeIdfrom the clock list to update, delete, enable, or disable a clock. To delete a reminder, use thetimeIdfrom the reminder list. - Updating a clock also enables it. To disable it afterward, call
enableEcholinkClockwithenable: false.
Usage notes
- All seven APIs use POST over Highway. The SDK sends parameters in the request body, including for both list APIs.
- Add, update, delete, and enable/disable operations return a boolean. The business result can be
false, so check the returned value. - This capability provides list and delete APIs for reminders. Clocks and reminders are separate records; use the corresponding APIs for each.